Use g_set_object() in a lot of places, and splrinkle some g_clear_object()

This commit is contained in:
Michael Natterer 2018-06-01 12:59:52 +02:00
parent 23ea457751
commit 1b7d63cce9
28 changed files with 129 additions and 413 deletions

View file

@ -270,22 +270,16 @@ colorsel_cmyk_set_config (GimpColorSelector *selector,
if (config != module->config)
{
if (module->config)
{
g_signal_handlers_disconnect_by_func (module->config,
colorsel_cmyk_config_changed,
module);
g_object_unref (module->config);
}
g_signal_handlers_disconnect_by_func (module->config,
colorsel_cmyk_config_changed,
module);
module->config = config;
g_set_object (&module->config, config);
if (module->config)
{
g_object_ref (module->config);
g_signal_connect_swapped (module->config, "notify",
G_CALLBACK (colorsel_cmyk_config_changed),
module);
}
g_signal_connect_swapped (module->config, "notify",
G_CALLBACK (colorsel_cmyk_config_changed),
module);
colorsel_cmyk_config_changed (module);
}

View file

@ -235,17 +235,14 @@ colorsel_water_set_config (GimpColorSelector *selector,
g_signal_handlers_disconnect_by_func (water->config,
colorsel_water_destroy_transform,
water);
g_object_unref (water->config);
colorsel_water_destroy_transform (water);
}
water->config = config;
g_set_object (&water->config, config);
if (water->config)
{
g_object_ref (water->config);
g_signal_connect_swapped (water->config, "notify",
G_CALLBACK (colorsel_water_destroy_transform),
water);

View file

@ -1463,17 +1463,14 @@ gimp_color_wheel_set_color_config (GimpColorWheel *wheel,
g_signal_handlers_disconnect_by_func (priv->config,
gimp_color_wheel_destroy_transform,
wheel);
g_object_unref (priv->config);
gimp_color_wheel_destroy_transform (wheel);
}
priv->config = config;
g_set_object (&priv->config, config);
if (priv->config)
{
g_object_ref (priv->config);
g_signal_connect_swapped (priv->config, "notify",
G_CALLBACK (gimp_color_wheel_destroy_transform),
wheel);