The function incorrectly destroys the connection at the release of the
first background job after close; it should wait until they've all
finished.
if (bg->prev) bg->prev->next = bg->next;
else a->bg = bg->next;
xfree(bg);
if (bg->prev) bg->prev->next = bg->next;
else a->bg = bg->next;
xfree(bg);
- if (a->f & AF_CLOSE) a_destroy(a);
+ if (!a->bg && (a->f & AF_CLOSE)) a_destroy(a);
}
/* --- @a_bgok@, @a_bginfo@, @a_bgfail@ --- *
}
/* --- @a_bgok@, @a_bginfo@, @a_bgfail@ --- *