From d28fe3514f86debfab0810e4ff4a670816268c67 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Tue, 26 Jun 2018 19:48:25 -0700 Subject: [PATCH] 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. --- monitor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.50.1