mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
GdkVisualX11: Add a dispose implementation
We need to be able to drop X resources before finalization.
This commit is contained in:
parent
459e10196d
commit
42e45f4f75
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user