Bug 768966 - Keyboard Shortcut hint disappears from tooltips...

...after entering single window mode

This commit fixes dangling pointers in GimpDockColumns, it doesn't fix
the bug but it's a prerequisite. Original patch by Massimo.
This commit is contained in:
Michael Natterer 2016-08-03 23:44:14 +02:00
parent 45922c71c7
commit 8d902b8df5
1 changed files with 41 additions and 0 deletions

View File

@ -189,6 +189,27 @@ gimp_dock_columns_dispose (GObject *object)
g_object_unref (dock);
}
if (dock_columns->p->context)
{
g_object_remove_weak_pointer (G_OBJECT (dock_columns->p->context),
(gpointer) &dock_columns->p->context);
dock_columns->p->context = NULL;
}
if (dock_columns->p->dialog_factory)
{
g_object_remove_weak_pointer (G_OBJECT (dock_columns->p->dialog_factory),
(gpointer) &dock_columns->p->dialog_factory);
dock_columns->p->dialog_factory = NULL;
}
if (dock_columns->p->ui_manager)
{
g_object_remove_weak_pointer (G_OBJECT (dock_columns->p->ui_manager),
(gpointer)&dock_columns->p->ui_manager);
dock_columns->p->ui_manager = NULL;
}
G_OBJECT_CLASS (parent_class)->dispose (object);
}
@ -203,13 +224,33 @@ gimp_dock_columns_set_property (GObject *object,
switch (property_id)
{
case PROP_CONTEXT:
if (dock_columns->p->context)
g_object_remove_weak_pointer (G_OBJECT (dock_columns->p->context),
(gpointer) &dock_columns->p->context);
dock_columns->p->context = g_value_get_object (value);
if (dock_columns->p->context)
g_object_add_weak_pointer (G_OBJECT (dock_columns->p->context),
(gpointer) &dock_columns->p->context);
break;
case PROP_DIALOG_FACTORY:
if (dock_columns->p->dialog_factory)
g_object_remove_weak_pointer (G_OBJECT (dock_columns->p->dialog_factory),
(gpointer) &dock_columns->p->dialog_factory);
dock_columns->p->dialog_factory = g_value_get_object (value);
if (dock_columns->p->dialog_factory)
g_object_add_weak_pointer (G_OBJECT (dock_columns->p->dialog_factory),
(gpointer) &dock_columns->p->dialog_factory);
break;
case PROP_UI_MANAGER:
if (dock_columns->p->ui_manager)
g_object_remove_weak_pointer (G_OBJECT (dock_columns->p->ui_manager),
(gpointer) &dock_columns->p->ui_manager);
dock_columns->p->ui_manager = g_value_get_object (value);
if (dock_columns->p->ui_manager)
g_object_add_weak_pointer (G_OBJECT (dock_columns->p->ui_manager),
(gpointer) &dock_columns->p->ui_manager);
break;
default: