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.
{
struct MonitorInfo info, info2;
+ if (!mailbox)
+ {
+ MonitorContextDescriptor = -1;
+ MonitorContextChanged = 0;
+ }
+
if (monitor_resolve(&info, mailbox) != RESOLVERES_OK_EXISTING)
return 2;
- if (!mailbox && (MonitorContextDescriptor == info.monitor->desc))
- MonitorContextDescriptor = -1;
-
if (Context)
{
if (mailbox)