X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flibsystemd-terminal%2Fsysview.c;fp=src%2Flibsystemd-terminal%2Fsysview.c;h=cd776f62d8c162ce8b5b2a5c11b1535d83bdd67f;hb=c17091b79773e9c458f03a897b26c2257d7366a7;hp=969514ad9de9370ac84f8ba1d4cd796f97969a64;hpb=ed3a9f6a30958ef90a24bc60aec86493974101d3;p=elogind.git diff --git a/src/libsystemd-terminal/sysview.c b/src/libsystemd-terminal/sysview.c index 969514ad9..cd776f62d 100644 --- a/src/libsystemd-terminal/sysview.c +++ b/src/libsystemd-terminal/sysview.c @@ -1437,20 +1437,6 @@ void sysview_context_stop(sysview_context *c) { log_debug("sysview: stop"); - c->running = false; - c->scanned = false; - c->event_fn = NULL; - c->userdata = NULL; - c->scan_src = sd_event_source_unref(c->scan_src); - context_ud_stop(c); - context_ld_stop(c); - - /* - * Event-callbacks are already cleared, hence we can safely ignore - * return codes of the context_remove_*() helpers. They cannot be - * originated from user-callbacks, so we already handled them. - */ - while ((device = hashmap_first(c->device_map))) context_remove_device(c, device); @@ -1459,6 +1445,14 @@ void sysview_context_stop(sysview_context *c) { while ((seat = hashmap_first(c->seat_map))) context_remove_seat(c, seat); + + c->running = false; + c->scanned = false; + c->event_fn = NULL; + c->userdata = NULL; + c->scan_src = sd_event_source_unref(c->scan_src); + context_ud_stop(c); + context_ld_stop(c); } static int context_scan_fn(sd_event_source *s, void *userdata) {