journal-remote: destroy event sources before MHD context
The MHD context owns the fd we watch via our event source, hence when we destroy the context before the event source the event source might still reference the fd that is now invalid. Hence swap the order.
This commit is contained in:
@@ -98,10 +98,11 @@ static MHDDaemonWrapper* MHDDaemonWrapper_free(MHDDaemonWrapper *d) {
|
||||
if (!d)
|
||||
return NULL;
|
||||
|
||||
d->io_event = sd_event_source_unref(d->io_event);
|
||||
d->timer_event = sd_event_source_unref(d->timer_event);
|
||||
|
||||
if (d->daemon)
|
||||
MHD_stop_daemon(d->daemon);
|
||||
sd_event_source_unref(d->io_event);
|
||||
sd_event_source_unref(d->timer_event);
|
||||
|
||||
return mfree(d);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user