mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
Avoid accessing freed memory when being replaced
If we are replaced via the window manager selection, then we close the MetaDisplay before meta_finalize() runs. We should be careful not to try to close the display again (and access already freed memory) in that case, so clear the global 'the_display' variable. See Metacity bug http://bugzilla.gnome.org/show_bug.cgi?id=588119 http://bugzilla.gnome.org/show_bug.cgi?id=592742
This commit is contained in:
parent
d804a1f146
commit
d58c9a57c6
@ -1007,6 +1007,7 @@ meta_display_close (MetaDisplay *display,
|
|||||||
meta_compositor_destroy (display->compositor);
|
meta_compositor_destroy (display->compositor);
|
||||||
|
|
||||||
g_object_unref (display);
|
g_object_unref (display);
|
||||||
|
the_display = NULL;
|
||||||
|
|
||||||
meta_quit (META_EXIT_SUCCESS);
|
meta_quit (META_EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -427,8 +427,11 @@ meta_select_display (gchar *display_name)
|
|||||||
static void
|
static void
|
||||||
meta_finalize (void)
|
meta_finalize (void)
|
||||||
{
|
{
|
||||||
meta_display_close (meta_get_display (),
|
MetaDisplay *display = meta_get_display ();
|
||||||
CurrentTime); /* I doubt correct timestamps matter here */
|
|
||||||
|
if (display)
|
||||||
|
meta_display_close (display,
|
||||||
|
CurrentTime); /* I doubt correct timestamps matter here */
|
||||||
|
|
||||||
meta_session_shutdown ();
|
meta_session_shutdown ();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user