]> granicus.if.org Git - mutt/commitdiff
Reset all MonitorContext state on context removal.
authorKevin McCarthy <kevin@8t8.us>
Wed, 27 Jun 2018 16:27:05 +0000 (09:27 -0700)
committerKevin McCarthy <kevin@8t8.us>
Wed, 27 Jun 2018 16:27:05 +0000 (09:27 -0700)
Reset both the descriptor and changed flag when the current context is
removed.  Don't make this dependent on the context being valid or
being found by monitor_resolve(), in case the context was closed due
to some type of error condition.

monitor.c

index c42fedca111aea5ee7edcba8ea489484b4730c92..79b4341b328d1c5de46f923d5b58d07882f49a47 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -414,12 +414,15 @@ int mutt_monitor_remove (BUFFY *buffy)
 {
   MONITORINFO info, info2;
 
+  if (!buffy)
+  {
+    MonitorContextDescriptor = -1;
+    MonitorContextChanged = 0;
+  }
+
   if (monitor_resolve (&info, buffy) != RESOLVERES_OK_EXISTING)
     return 2;
 
-  if (!buffy && (MonitorContextDescriptor == info.monitor->descr))
-    MonitorContextDescriptor = -1;
-
   if (Context)
   {
     if (buffy)