app: free GimpEditSelectionTool's stuff in finalize()
This commit is contained in:
parent
413af2ed85
commit
7d220a56e0
1 changed files with 39 additions and 14 deletions
|
|
@ -105,6 +105,8 @@ struct _GimpEditSelectionToolClass
|
|||
};
|
||||
|
||||
|
||||
static void gimp_edit_selection_tool_finalize (GObject *object);
|
||||
|
||||
static void gimp_edit_selection_tool_button_release (GimpTool *tool,
|
||||
const GimpCoords *coords,
|
||||
guint32 time,
|
||||
|
|
@ -136,9 +138,12 @@ G_DEFINE_TYPE (GimpEditSelectionTool, gimp_edit_selection_tool,
|
|||
static void
|
||||
gimp_edit_selection_tool_class_init (GimpEditSelectionToolClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
|
||||
GimpDrawToolClass *draw_class = GIMP_DRAW_TOOL_CLASS (klass);
|
||||
|
||||
object_class->finalize = gimp_edit_selection_tool_finalize;
|
||||
|
||||
tool_class->button_release = gimp_edit_selection_tool_button_release;
|
||||
tool_class->motion = gimp_edit_selection_tool_motion;
|
||||
tool_class->active_modifier_key = gimp_edit_selection_tool_active_modifier_key;
|
||||
|
|
@ -152,6 +157,40 @@ gimp_edit_selection_tool_init (GimpEditSelectionTool *edit_select)
|
|||
edit_select->first_move = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_edit_selection_tool_finalize (GObject *object)
|
||||
{
|
||||
GimpEditSelectionTool *edit_select = GIMP_EDIT_SELECTION_TOOL (object);
|
||||
|
||||
if (edit_select->segs_in)
|
||||
{
|
||||
g_free (edit_select->segs_in);
|
||||
edit_select->segs_in = NULL;
|
||||
edit_select->num_segs_in = 0;
|
||||
}
|
||||
|
||||
if (edit_select->segs_out)
|
||||
{
|
||||
g_free (edit_select->segs_out);
|
||||
edit_select->segs_out = NULL;
|
||||
edit_select->num_segs_out = 0;
|
||||
}
|
||||
|
||||
if (edit_select->live_items)
|
||||
{
|
||||
g_list_free (edit_select->live_items);
|
||||
edit_select->live_items = NULL;
|
||||
}
|
||||
|
||||
if (edit_select->delayed_items)
|
||||
{
|
||||
g_list_free (edit_select->delayed_items);
|
||||
edit_select->delayed_items = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_edit_selection_tool_calc_coords (GimpEditSelectionTool *edit_select,
|
||||
gdouble x,
|
||||
|
|
@ -529,20 +568,6 @@ gimp_edit_selection_tool_button_release (GimpTool *tool,
|
|||
|
||||
gimp_image_flush (image);
|
||||
|
||||
g_free (edit_select->segs_in);
|
||||
g_free (edit_select->segs_out);
|
||||
|
||||
edit_select->segs_in = NULL;
|
||||
edit_select->segs_out = NULL;
|
||||
edit_select->num_segs_in = 0;
|
||||
edit_select->num_segs_out = 0;
|
||||
|
||||
g_list_free (edit_select->live_items);
|
||||
g_list_free (edit_select->delayed_items);
|
||||
|
||||
edit_select->live_items = NULL;
|
||||
edit_select->delayed_items = NULL;
|
||||
|
||||
if (edit_select->propagate_release &&
|
||||
tool_manager_get_active (display->gimp))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue