From: Kevin McCarthy Date: Wed, 27 Jun 2018 16:27:05 +0000 (-0700) Subject: Reset all MonitorContext state on context removal. X-Git-Tag: mutt-1-11-rel~127 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=68d0e90f11f689c2896a024d22b34a84224659e7;p=mutt Reset all MonitorContext state on context removal. 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. --- diff --git a/monitor.c b/monitor.c index c42fedca..79b4341b 100644 --- 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)