gtk+ r21834 - in trunk: . gdk/x11
- From: cdywan svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r21834 - in trunk: . gdk/x11
- Date: Sun, 30 Nov 2008 05:33:57 +0000 (UTC)
Author: cdywan
Date: Sun Nov 30 05:33:57 2008
New Revision: 21834
URL: http://svn.gnome.org/viewvc/gtk+?rev=21834&view=rev
Log:
2008-11-30 Christian Dywan <christian imendio com>
Bug 559622 â GdkDevice test segfaults
* gdk/x11/gdkdisplay-x11.c (gdk_display_x11_dispose):
* gdk/x11/gdkinput.c (gdk_device_class_init), (gdk_device_dispose):
Free and reset device in dispose. Patch by Michael Natterer and myself.
Modified:
trunk/ChangeLog
trunk/gdk/x11/gdkdisplay-x11.c
trunk/gdk/x11/gdkinput.c
Modified: trunk/gdk/x11/gdkdisplay-x11.c
==============================================================================
--- trunk/gdk/x11/gdkdisplay-x11.c (original)
+++ trunk/gdk/x11/gdkdisplay-x11.c Sun Nov 30 05:33:57 2008
@@ -798,6 +798,8 @@
GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (object);
gint i;
+ g_list_foreach (display_x11->input_devices, (GFunc) g_object_run_dispose, NULL);
+
for (i = 0; i < ScreenCount (display_x11->xdisplay); i++)
_gdk_screen_close (display_x11->screens[i]);
Modified: trunk/gdk/x11/gdkinput.c
==============================================================================
--- trunk/gdk/x11/gdkinput.c (original)
+++ trunk/gdk/x11/gdkinput.c Sun Nov 30 05:33:57 2008
@@ -64,7 +64,7 @@
}
static void gdk_device_class_init (GdkDeviceClass *klass);
-static void gdk_device_finalize (GObject *object);
+static void gdk_device_dispose (GObject *object);
static gpointer gdk_device_parent_class = NULL;
@@ -103,29 +103,36 @@
gdk_device_parent_class = g_type_class_peek_parent (klass);
- object_class->finalize = gdk_device_finalize;
+ object_class->dispose = gdk_device_dispose;
}
static void
-gdk_device_finalize (GObject *object)
+gdk_device_dispose (GObject *object)
{
- GdkDevicePrivate *gdkdev = (GdkDevicePrivate *)GDK_DEVICE(object);
+ GdkDevicePrivate *gdkdev = (GdkDevicePrivate *) object;
- if (!GDK_IS_CORE (gdkdev))
+ if (gdkdev->display && !GDK_IS_CORE (gdkdev))
{
#ifndef XINPUT_NONE
if (gdkdev->xdevice)
- XCloseDevice (GDK_DISPLAY_XDISPLAY(gdkdev->display), gdkdev->xdevice);
-
+ {
+ XCloseDevice (GDK_DISPLAY_XDISPLAY (gdkdev->display), gdkdev->xdevice);
+ gdkdev->xdevice = NULL;
+ }
g_free (gdkdev->axes);
+ gdkdev->axes = NULL;
#endif /* !XINPUT_NONE */
g_free (gdkdev->info.name);
g_free (gdkdev->info.keys);
g_free (gdkdev->info.axes);
+
+ gdkdev->info.name = NULL;
+ gdkdev->info.keys = NULL;
+ gdkdev->info.axes = NULL;
}
- G_OBJECT_CLASS (gdk_device_parent_class)->finalize (object);
+ G_OBJECT_CLASS (gdk_device_parent_class)->dispose (object);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]