From: Kevin McCarthy Date: Wed, 27 Jun 2018 02:48:25 +0000 (-0700) Subject: Fix MonitorContextDescriptor update on removal. X-Git-Tag: mutt-1-11-rel~128 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d28fe3514f86debfab0810e4ff4a670816268c67;p=mutt Fix MonitorContextDescriptor update on removal. Reset the context descriptor before checking for the monitor being shared by another mailbox. Technically, it would be set properly during the next add, but it shouldn't be left incorrect. --- diff --git a/monitor.c b/monitor.c index da9afc69..c42fedca 100644 --- a/monitor.c +++ b/monitor.c @@ -417,6 +417,9 @@ int mutt_monitor_remove (BUFFY *buffy) if (monitor_resolve (&info, buffy) != RESOLVERES_OK_EXISTING) return 2; + if (!buffy && (MonitorContextDescriptor == info.monitor->descr)) + MonitorContextDescriptor = -1; + if (Context) { if (buffy) @@ -435,9 +438,6 @@ int mutt_monitor_remove (BUFFY *buffy) inotify_rm_watch(info.monitor->descr, INotifyFd); dprint (3, (debugfile, "monitor: inotify_rm_watch for '%s' descriptor=%d\n", info.path, info.monitor->descr)); - if (!buffy && (MonitorContextDescriptor == info.monitor->descr)) - MonitorContextDescriptor = -1; - monitor_delete (info.monitor); monitor_check_free (); return 0;