app: use g_clear_pointer() in more places
(cherry picked from commit 901350ba20
)
This commit is contained in:
@ -130,18 +130,10 @@ gimp_canvas_boundary_finalize (GObject *object)
|
||||
{
|
||||
GimpCanvasBoundaryPrivate *private = GET_PRIVATE (object);
|
||||
|
||||
if (private->segs)
|
||||
{
|
||||
g_free (private->segs);
|
||||
private->segs = NULL;
|
||||
private->n_segs = 0;
|
||||
}
|
||||
g_clear_pointer (&private->segs, g_free);
|
||||
private->n_segs = 0;
|
||||
|
||||
if (private->transform)
|
||||
{
|
||||
g_free (private->transform);
|
||||
private->transform = NULL;
|
||||
}
|
||||
g_clear_pointer (&private->transform, g_free);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
@ -121,18 +121,10 @@ gimp_canvas_polygon_finalize (GObject *object)
|
||||
{
|
||||
GimpCanvasPolygonPrivate *private = GET_PRIVATE (object);
|
||||
|
||||
if (private->points)
|
||||
{
|
||||
g_free (private->points);
|
||||
private->points = NULL;
|
||||
private->n_points = 0;
|
||||
}
|
||||
g_clear_pointer (&private->points, g_free);
|
||||
private->n_points = 0;
|
||||
|
||||
if (private->transform)
|
||||
{
|
||||
g_free (private->transform);
|
||||
private->transform = NULL;
|
||||
}
|
||||
g_clear_pointer (&private->transform, g_free);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
@ -151,8 +143,7 @@ gimp_canvas_polygon_set_property (GObject *object,
|
||||
{
|
||||
GimpArray *array = g_value_get_boxed (value);
|
||||
|
||||
g_free (private->points);
|
||||
private->points = NULL;
|
||||
g_clear_pointer (&private->points, g_free);
|
||||
private->n_points = 0;
|
||||
|
||||
if (array)
|
||||
|
@ -173,11 +173,7 @@ gimp_canvas_progress_finalize (GObject *object)
|
||||
{
|
||||
GimpCanvasProgressPrivate *private = GET_PRIVATE (object);
|
||||
|
||||
if (private->text)
|
||||
{
|
||||
g_free (private->text);
|
||||
private->text = NULL;
|
||||
}
|
||||
g_clear_pointer (&private->text, g_free);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
@ -819,11 +819,7 @@ gimp_tool_rectangle_finalize (GObject *object)
|
||||
GimpToolRectangle *rectangle = GIMP_TOOL_RECTANGLE (object);
|
||||
GimpToolRectanglePrivate *private = rectangle->private;
|
||||
|
||||
if (private->status_title)
|
||||
{
|
||||
g_free (private->status_title);
|
||||
private->status_title = NULL;
|
||||
}
|
||||
g_clear_pointer (&private->status_title, g_free);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
Reference in New Issue
Block a user