ShellAppMonitor: Fix case of not seeing apps being closed

Remove the app from the window_to_app hash *before* emitting
CHANGED, otherwise a signal handler could see stale data.
This commit is contained in:
Colin Walters 2009-08-05 20:07:30 -04:00
parent 21858d928a
commit 90979faedd

View File

@ -532,10 +532,11 @@ shell_app_monitor_on_window_removed (MetaWorkspace *workspace,
self->watched_window = NULL; self->watched_window = NULL;
usage->window_count--; usage->window_count--;
/* Remove before emitting */
g_hash_table_remove (self->window_to_app, window);
if (usage->window_count == 0) if (usage->window_count == 0)
g_signal_emit (self, signals[CHANGED], 0); g_signal_emit (self, signals[CHANGED], 0);
g_hash_table_remove (self->window_to_app, window);
} }
static void static void