[gegl] Fix a bad unref and a memory leak



commit 3e38920b41a0d1f163a843303301c976391f0df4
Author: awaw fumin <awawfumin gmail com>
Date:   Tue Mar 11 14:22:28 2014 +0800

    Fix a bad unref and a memory leak

 seamless-clone/sc-context.c |    3 ++-
 seamless-clone/sc-sample.c  |    2 --
 2 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/seamless-clone/sc-context.c b/seamless-clone/sc-context.c
index 9b814d7..0e88fc7 100644
--- a/seamless-clone/sc-context.c
+++ b/seamless-clone/sc-context.c
@@ -187,6 +187,7 @@ gegl_sc_context_update_from_outline (GeglScContext *self,
 
   if (self->mesh != NULL)
     {
+      p2tr_mesh_clear (self->mesh);
       p2tr_mesh_unref (self->mesh);
       self->mesh = NULL;
     }
@@ -778,7 +779,7 @@ gegl_sc_context_free (GeglScContext *context)
    * The reason is because the N points in context->mesh holds N references
    * back to context->mesh itself, and an initiative to break these circular
    * references is needed. */
-  p2tr_mesh_clear(context->mesh);
+  p2tr_mesh_clear (context->mesh);
   p2tr_mesh_unref (context->mesh);
 
   gegl_sc_outline_free (context->outline);
diff --git a/seamless-clone/sc-sample.c b/seamless-clone/sc-sample.c
index 8f5c7fd..5c23b8d 100644
--- a/seamless-clone/sc-sample.c
+++ b/seamless-clone/sc-sample.c
@@ -245,8 +245,6 @@ gegl_sc_mesh_sampling_entry_free_hfunc (gpointer point,
                                         gpointer sampling_list,
                                         gpointer unused)
 {
-  /* Unref the point returned from triangulation_get_points */
-  p2tr_point_unref ((P2trPoint*)point);
   /* Free the sampling list */
   gegl_sc_sample_list_free ((GeglScSampleList*)sampling_list);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]