Commit 42e45f4f authored by Matthias Clasen's avatar Matthias Clasen

GdkVisualX11: Add a dispose implementation

We need to be able to drop X resources before finalization.
parent 459e1019
......@@ -87,12 +87,28 @@ gdk_x11_visual_finalize (GObject *object)
G_OBJECT_CLASS (gdk_x11_visual_parent_class)->finalize (object);
}
static void
gdk_x11_visual_dispose (GObject *object)
{
GdkVisual *visual = (GdkVisual *)object;
GdkX11Visual *x11_visual = (GdkX11Visual *)object;
if (x11_visual->colormap != None)
{
XFreeColormap (GDK_SCREEN_XDISPLAY (visual->screen), x11_visual->colormap);
x11_visual->colormap = None;
}
G_OBJECT_CLASS (gdk_x11_visual_parent_class)->dispose (object);
}
static void
gdk_x11_visual_class_init (GdkX11VisualClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->finalize = gdk_x11_visual_finalize;
object_class->dispose = gdk_x11_visual_dispose;
}
void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment