mirror of
https://github.com/brl/mutter.git
synced 2025-01-10 11:42:49 +00:00
Bug 856 - Teardown sequence is borked
* clutter/clutter-main.c: Don't free the ClutterMainContext so that the main loop can be restarted. * clutter/eglx/clutter-backend-egl.c: * clutter/eglnative/clutter-backend-egl.c: Register an atexit handler which disposes the backend object so that we are still guaranteed to call eglTerminate on GLES.
This commit is contained in:
parent
21c1986a41
commit
72c9f88019
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
||||
2008-09-22 Neil Roberts <neil@linux.intel.com>
|
||||
|
||||
Bug 856 - Teardown sequence is borked
|
||||
|
||||
* clutter/clutter-main.c: Don't free the ClutterMainContext so
|
||||
that the main loop can be restarted.
|
||||
|
||||
* clutter/eglx/clutter-backend-egl.c:
|
||||
* clutter/eglnative/clutter-backend-egl.c: Register an atexit
|
||||
handler which disposes the backend object so that we are still
|
||||
guaranteed to call eglTerminate on GLES.
|
||||
|
||||
2008-09-22 Neil Roberts <neil@linux.intel.com>
|
||||
|
||||
* tests/test-unproject.c (on_event):
|
||||
|
@ -395,29 +395,6 @@ _clutter_do_pick (ClutterStage *stage,
|
||||
return clutter_get_actor_by_gid (id);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_context_free (ClutterMainContext *context)
|
||||
{
|
||||
/* this will take care of destroying the stage */
|
||||
g_object_unref (context->backend);
|
||||
context->backend = NULL;
|
||||
|
||||
clutter_id_pool_free (context->id_pool);
|
||||
context->id_pool = NULL;
|
||||
|
||||
g_object_unref (context->font_map);
|
||||
context->font_map = NULL;
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
g_timer_destroy (context->timer);
|
||||
#endif
|
||||
|
||||
/* XXX: The cleaning up of the event queue should be moved here from
|
||||
the backend base class. */
|
||||
|
||||
g_free (context);
|
||||
}
|
||||
|
||||
PangoContext *
|
||||
_clutter_context_create_pango_context (ClutterMainContext *self)
|
||||
{
|
||||
@ -473,9 +450,11 @@ clutter_main_level (void)
|
||||
void
|
||||
clutter_main (void)
|
||||
{
|
||||
ClutterMainContext *context = CLUTTER_CONTEXT ();
|
||||
GMainLoop *loop;
|
||||
|
||||
/* Make sure there is a context */
|
||||
CLUTTER_CONTEXT ();
|
||||
|
||||
if (!clutter_is_initialized)
|
||||
{
|
||||
g_warning ("Called clutter_main() but Clutter wasn't initialised. "
|
||||
@ -510,11 +489,6 @@ clutter_main (void)
|
||||
|
||||
clutter_main_loop_level--;
|
||||
|
||||
if (clutter_main_loop_level == 0)
|
||||
{
|
||||
clutter_context_free (context);
|
||||
}
|
||||
|
||||
CLUTTER_MARK ();
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,13 @@ static ClutterBackendEGL *backend_singleton = NULL;
|
||||
|
||||
G_DEFINE_TYPE (ClutterBackendEGL, clutter_backend_egl, CLUTTER_TYPE_BACKEND);
|
||||
|
||||
static void
|
||||
clutter_backend_at_exit (void)
|
||||
{
|
||||
if (backend_singleton)
|
||||
g_object_run_dispose (G_OBJECT (backend_singleton));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_backend_egl_pre_parse (ClutterBackend *backend,
|
||||
GError **error)
|
||||
@ -33,6 +40,8 @@ clutter_backend_egl_post_parse (ClutterBackend *backend,
|
||||
&backend_egl->egl_version_major,
|
||||
&backend_egl->egl_version_minor);
|
||||
|
||||
g_atexit (clutter_backend_at_exit);
|
||||
|
||||
if (status != EGL_TRUE)
|
||||
{
|
||||
g_set_error (error, CLUTTER_INIT_ERROR,
|
||||
|
@ -13,6 +13,13 @@ static ClutterBackendEGL *backend_singleton = NULL;
|
||||
|
||||
G_DEFINE_TYPE (ClutterBackendEGL, clutter_backend_egl, CLUTTER_TYPE_BACKEND_X11);
|
||||
|
||||
static void
|
||||
clutter_backend_at_exit (void)
|
||||
{
|
||||
if (backend_singleton)
|
||||
g_object_run_dispose (G_OBJECT (backend_singleton));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_backend_egl_post_parse (ClutterBackend *backend,
|
||||
GError **error)
|
||||
@ -31,6 +38,8 @@ clutter_backend_egl_post_parse (ClutterBackend *backend,
|
||||
&backend_egl->egl_version_major,
|
||||
&backend_egl->egl_version_minor);
|
||||
|
||||
g_atexit (clutter_backend_at_exit);
|
||||
|
||||
if (status != EGL_TRUE)
|
||||
{
|
||||
g_set_error (error, CLUTTER_INIT_ERROR,
|
||||
|
Loading…
Reference in New Issue
Block a user