mirror of https://github.com/GNOME/gimp.git
app: fixes g_object_unref: assertion 'G_IS_OBJECT (object)' failed.
"binding" data can be set to NULL. Do not assume it is a proper object. Also I was tempted to use g_object_set_data() to simply free the GBinding object on setting a new data, but such object will also be freed when the widget is destroyed by default. So that would also end up in double destruction. Instead just keep current logics. This CRITICAL was reported in #3133 but this is not the main bug.
This commit is contained in:
parent
7cf06c3f60
commit
af6760b3c9
|
@ -276,27 +276,21 @@ static void
|
|||
gimp_prop_gui_chain_toggled (GimpChainButton *chain,
|
||||
GtkAdjustment *x_adj)
|
||||
{
|
||||
GBinding *binding;
|
||||
GtkAdjustment *y_adj;
|
||||
|
||||
y_adj = g_object_get_data (G_OBJECT (x_adj), "y-adjustment");
|
||||
|
||||
if (gimp_chain_button_get_active (chain))
|
||||
{
|
||||
GBinding *binding;
|
||||
|
||||
binding = g_object_bind_property (x_adj, "value",
|
||||
y_adj, "value",
|
||||
G_BINDING_BIDIRECTIONAL);
|
||||
|
||||
g_object_set_data (G_OBJECT (chain), "binding", binding);
|
||||
}
|
||||
else
|
||||
{
|
||||
GBinding *binding;
|
||||
|
||||
binding = g_object_get_data (G_OBJECT (chain), "binding");
|
||||
|
||||
g_object_unref (binding);
|
||||
g_object_set_data (G_OBJECT (chain), "binding", NULL);
|
||||
g_clear_object (&binding);
|
||||
}
|
||||
g_object_set_data (G_OBJECT (chain), "binding", binding);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue