shell-app: Don't crash when trying to dispose
If we dispose a ShellApp that has windows left, then we'll crash when we remove the last window, as that frees and NULLs out app->running_state. https://bugzilla.gnome.org/show_bug.cgi?id=723197
This commit is contained in:
parent
7c8c811134
commit
36c69124f7
@ -1384,11 +1384,9 @@ shell_app_dispose (GObject *object)
|
|||||||
|
|
||||||
g_clear_object (&app->info);
|
g_clear_object (&app->info);
|
||||||
|
|
||||||
if (app->running_state)
|
while (app->running_state)
|
||||||
{
|
_shell_app_remove_window (app, app->running_state->windows->data);
|
||||||
while (app->running_state->windows)
|
|
||||||
_shell_app_remove_window (app, app->running_state->windows->data);
|
|
||||||
}
|
|
||||||
/* We should have been transitioned when we removed all of our windows */
|
/* We should have been transitioned when we removed all of our windows */
|
||||||
g_assert (app->state == SHELL_APP_STATE_STOPPED);
|
g_assert (app->state == SHELL_APP_STATE_STOPPED);
|
||||||
g_assert (app->running_state == NULL);
|
g_assert (app->running_state == NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user