diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 19074e334..7e0286d9a 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -7224,11 +7224,11 @@ clutter_actor_set_shader (ClutterActor *self, g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE); g_return_val_if_fail (shader == NULL || CLUTTER_IS_SHADER (shader), FALSE); - /* if shader passed in is NULL we destroy the shader */ - if (shader == NULL) - { - destroy_shader_data (self); - } + if (shader) + g_object_ref (shader); + else + /* if shader passed in is NULL we destroy the shader */ + destroy_shader_data (self); actor_priv = self->priv; shader_data = actor_priv->shader_data; @@ -7242,15 +7242,9 @@ clutter_actor_set_shader (ClutterActor *self, shader_value_free); } if (shader_data->shader) - { - g_object_unref (shader_data->shader); - shader_data->shader = NULL; - } + g_object_unref (shader_data->shader); - if (shader) - { - shader_data->shader = g_object_ref (shader); - } + shader_data->shader = shader; if (CLUTTER_ACTOR_IS_VISIBLE (self)) clutter_actor_queue_redraw (self); diff --git a/clutter/clutter-alpha.c b/clutter/clutter-alpha.c index e1c6966e9..dc1dddeba 100644 --- a/clutter/clutter-alpha.c +++ b/clutter/clutter-alpha.c @@ -395,6 +395,9 @@ clutter_alpha_set_timeline (ClutterAlpha *alpha, priv = alpha->priv; + if (priv->timeline == timeline) + return; + if (priv->timeline) { g_signal_handlers_disconnect_by_func (priv->timeline, diff --git a/clutter/clutter-behaviour.c b/clutter/clutter-behaviour.c index 11da23d35..006be1bda 100644 --- a/clutter/clutter-behaviour.c +++ b/clutter/clutter-behaviour.c @@ -570,6 +570,9 @@ clutter_behaviour_set_alpha (ClutterBehaviour *behave, priv = behave->priv; + if (alpha) + g_object_ref_sink (alpha); + if (priv->notify_id) { CLUTTER_NOTE (BEHAVIOUR, "removing previous notify-id (%d)", @@ -590,7 +593,6 @@ clutter_behaviour_set_alpha (ClutterBehaviour *behave, if (alpha) { priv->alpha = alpha; - g_object_ref_sink (priv->alpha); priv->notify_id = g_signal_connect (priv->alpha, "notify::alpha", G_CALLBACK(notify_cb), diff --git a/clutter/clutter-clone-texture.c b/clutter/clutter-clone-texture.c index c92bada82..a2350cbab 100644 --- a/clutter/clutter-clone-texture.c +++ b/clutter/clutter-clone-texture.c @@ -221,6 +221,9 @@ set_parent_texture (ClutterCloneTexture *ctexture, ClutterActor *actor = CLUTTER_ACTOR (ctexture); gboolean was_visible = CLUTTER_ACTOR_IS_VISIBLE (ctexture); + if (priv->parent_texture == texture) + return; + if (priv->parent_texture) { g_object_unref (priv->parent_texture);