From 09de87b0e540bfb6c0fc12e34625388bcc12fdc9 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 24 Oct 2011 12:07:30 +0100 Subject: [PATCH] backend: Remove atexit handlers The g_atexit() function has been deprecated in GLib as it is a fairly bad idea in basically all cases. We could probably use a GCC destructor if we didn't care about portability, but for the time being we just remove the atexit() handler that disposed the backend. --- clutter/cogl/clutter-backend-cogl.c | 9 --------- clutter/wayland/clutter-backend-wayland.c | 9 --------- 2 files changed, 18 deletions(-) diff --git a/clutter/cogl/clutter-backend-cogl.c b/clutter/cogl/clutter-backend-cogl.c index 1ca885025..b6881c8bd 100644 --- a/clutter/cogl/clutter-backend-cogl.c +++ b/clutter/cogl/clutter-backend-cogl.c @@ -71,13 +71,6 @@ G_DEFINE_TYPE (ClutterBackendCogl, _clutter_backend_cogl, CLUTTER_TYPE_BACKEND_X G_DEFINE_TYPE (ClutterBackendCogl, _clutter_backend_cogl, CLUTTER_TYPE_BACKEND); #endif -static void -clutter_backend_at_exit (void) -{ - if (backend_singleton) - g_object_run_dispose (G_OBJECT (backend_singleton)); -} - const gchar* _clutter_backend_cogl_get_vblank (void) { @@ -124,8 +117,6 @@ clutter_backend_cogl_post_parse (ClutterBackend *backend, return TRUE; #endif - g_atexit (clutter_backend_at_exit); - return TRUE; } diff --git a/clutter/wayland/clutter-backend-wayland.c b/clutter/wayland/clutter-backend-wayland.c index 56c23a251..5ade5b38d 100644 --- a/clutter/wayland/clutter-backend-wayland.c +++ b/clutter/wayland/clutter-backend-wayland.c @@ -52,13 +52,6 @@ static ClutterBackendWayland *backend_singleton = NULL; G_DEFINE_TYPE (ClutterBackendWayland, _clutter_backend_wayland, 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_wayland_pre_parse (ClutterBackend *backend, GError **error) @@ -281,8 +274,6 @@ clutter_backend_wayland_post_parse (ClutterBackend *backend, ClutterBackendWayland *backend_wayland = CLUTTER_BACKEND_WAYLAND (backend); EGLBoolean status; - g_atexit (clutter_backend_at_exit); - /* TODO: expose environment variable/commandline option for this... */ backend_wayland->wayland_display = wl_display_connect (NULL); if (!backend_wayland->wayland_display)