diff --git a/ChangeLog b/ChangeLog index 0e7ec44b3d..0566c99a95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-11-16 Michael Natterer + + * gdk/x11/gdkevents-x11.c (_gdk_events_uninit): new internal + function which destroys the display's event source. Also removes + the source from the global display_sources list and unrefs it. + + * gdk/x11/gdkprivate-x11.h: declare the function. + + * gdk/x11/gdkdisplay-x11.c (gdk_display_x11_dispose): call it + instead of half-destroying the source here. + 2005-11-15 Matthias Clasen * gtk/gtktreestore.c (gtk_tree_store_move): Fix a memory diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0e7ec44b3d..0566c99a95 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,14 @@ +2005-11-16 Michael Natterer + + * gdk/x11/gdkevents-x11.c (_gdk_events_uninit): new internal + function which destroys the display's event source. Also removes + the source from the global display_sources list and unrefs it. + + * gdk/x11/gdkprivate-x11.h: declare the function. + + * gdk/x11/gdkdisplay-x11.c (gdk_display_x11_dispose): call it + instead of half-destroying the source here. + 2005-11-15 Matthias Clasen * gtk/gtktreestore.c (gtk_tree_store_move): Fix a memory diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index b69d6a211d..62fd4bde41 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -726,11 +726,7 @@ gdk_display_x11_dispose (GObject *object) for (i = 0; i < n_screens; i++) _gdk_screen_close (display_x11->screens[i]); - if (display_x11->event_source) - { - g_source_destroy (display_x11->event_source); - display_x11->event_source = NULL; - } + _gdk_events_uninit (GDK_DISPLAY_OBJECT (object)); G_OBJECT_CLASS (parent_class)->dispose (object); } diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c index 4a06cb0dd6..42da31f6d7 100644 --- a/gdk/x11/gdkevents-x11.c +++ b/gdk/x11/gdkevents-x11.c @@ -230,6 +230,20 @@ _gdk_events_init (GdkDisplay *display) NULL); } +void +_gdk_events_uninit (GdkDisplay *display) +{ + GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display); + + if (display_x11->event_source) + { + display_sources = g_list_remove (display_sources, + display_x11->event_source); + g_source_destroy (display_x11->event_source); + g_source_unref (display_x11->event_source); + display_x11->event_source = NULL; + } +} /** * gdk_events_pending: diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h index 73f4410c32..0bd1868a05 100644 --- a/gdk/x11/gdkprivate-x11.h +++ b/gdk/x11/gdkprivate-x11.h @@ -170,6 +170,7 @@ void _gdk_x11_events_init_screen (GdkScreen *screen); void _gdk_x11_events_uninit_screen (GdkScreen *screen); void _gdk_events_init (GdkDisplay *display); +void _gdk_events_uninit (GdkDisplay *display); void _gdk_windowing_window_init (GdkScreen *screen); void _gdk_visual_init (GdkScreen *screen); void _gdk_dnd_init (GdkDisplay *display);