Bug 591626 - Fix crash in ShellAppMonitor

Pass application into signal as expected.  Be sure to reference
it across the call, since removal from the hash unrefs it.
This commit is contained in:
Colin Walters 2009-08-12 19:45:17 -04:00
parent 1e41f869de
commit 51723bb93b

View File

@ -595,6 +595,8 @@ shell_app_monitor_on_window_removed (MetaWorkspace *workspace,
if (!app) if (!app)
return; return;
shell_app_info_ref (app);
usage = get_app_usage_from_window (self, window); usage = get_app_usage_from_window (self, window);
if (window == self->watched_window) if (window == self->watched_window)
@ -609,8 +611,10 @@ shell_app_monitor_on_window_removed (MetaWorkspace *workspace,
if (usage->window_count == 0) if (usage->window_count == 0)
{ {
usage->initially_seen_sequence = 0; usage->initially_seen_sequence = 0;
g_signal_emit (self, signals[APP_REMOVED], 0); g_signal_emit (self, signals[APP_REMOVED], 0, app);
} }
shell_app_info_unref (app);
} }
static void static void