From ae3a20a0a0e4adbea7dcc22628d3e32039d65463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 9 Nov 2023 22:40:43 +0800 Subject: [PATCH] clutter/paint-nodes: Use g_clear_object() in a few places It's possible now that they are GObject's. Part-of: --- clutter/clutter/clutter-paint-nodes.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/clutter/clutter/clutter-paint-nodes.c b/clutter/clutter/clutter-paint-nodes.c index 40ce4fb7c..acbdfbef8 100644 --- a/clutter/clutter/clutter-paint-nodes.c +++ b/clutter/clutter/clutter-paint-nodes.c @@ -358,8 +358,7 @@ clutter_pipeline_node_finalize (ClutterPaintNode *node) { ClutterPipelineNode *pnode = CLUTTER_PIPELINE_NODE (node); - if (pnode->pipeline != NULL) - g_object_unref (pnode->pipeline); + g_clear_object (&pnode->pipeline); CLUTTER_PAINT_NODE_CLASS (clutter_pipeline_node_parent_class)->finalize (node); } @@ -720,8 +719,7 @@ clutter_text_node_finalize (ClutterPaintNode *node) { ClutterTextNode *tnode = CLUTTER_TEXT_NODE (node); - if (tnode->layout != NULL) - g_object_unref (tnode->layout); + g_clear_object (&tnode->layout); CLUTTER_PAINT_NODE_CLASS (clutter_text_node_parent_class)->finalize (node); } @@ -1264,9 +1262,7 @@ clutter_layer_node_finalize (ClutterPaintNode *node) { ClutterLayerNode *lnode = CLUTTER_LAYER_NODE (node); - if (lnode->pipeline != NULL) - g_object_unref (lnode->pipeline); - + g_clear_object (&lnode->pipeline); g_clear_object (&lnode->offscreen); CLUTTER_PAINT_NODE_CLASS (clutter_layer_node_parent_class)->finalize (node);