[bijiben] note-id: Fix parent relationship



commit 9844a900464e871da56fc77f02f49d67f58019ef
Author: Isaque Galdino <igaldino gmail com>
Date:   Wed Apr 18 00:24:34 2018 -0300

    note-id: Fix parent relationship
    
    NoteObj was keeping a refence to a NoteID object in the creation time.
    The NoteID object, though, was left without parent after NoteObj
    creation, leaking memory.
    
    This patch removes the reference NoteObj had to NoteID and make it
    NoteID's parent, being responsible for releasing memory when it's
    finalized.

 src/libbiji/biji-note-obj.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/libbiji/biji-note-obj.c b/src/libbiji/biji-note-obj.c
index 286a29e..45217bf 100644
--- a/src/libbiji/biji-note-obj.c
+++ b/src/libbiji/biji-note-obj.c
@@ -176,7 +176,8 @@ biji_note_obj_set_property (GObject      *object,
   switch (property_id)
     {
     case PROP_ID:
-      priv->id = g_value_dup_object (value);
+      /* From now on BijiNoteID is managed by BijiNoteObj */
+      priv->id = g_value_get_object (value);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);


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