Commit 8d902b8d authored by Michael Natterer's avatar Michael Natterer 😴

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.
parent 45922c71
......@@ -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:
......
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