[ekiga] Fixed leaking the opal account store in the assistant



commit c4d2d95746dc5775ed110e8416ec2148152c0d31
Author: Julien Puydt <jpuydt newton localdomain>
Date:   Sun Jul 31 19:45:53 2011 +0200

    Fixed leaking the opal account store in the assistant
    
    In fact, the problem was that the private structure of that GObject was created using pure C code...
    That means the C++ ctor/dtor of the members weren't being called. I made that structure managed using
    new/delete, and now things look good.
    
    Notice that we were probably leaking the video input core, the audio input core and the audio output core too!

 src/gui/assistant.cpp |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/gui/assistant.cpp b/src/gui/assistant.cpp
index 9d9dfb1..667307b 100644
--- a/src/gui/assistant.cpp
+++ b/src/gui/assistant.cpp
@@ -1454,8 +1454,7 @@ prepare_summary_page (EkigaAssistant *assistant)
 static void
 ekiga_assistant_init (EkigaAssistant *assistant)
 {
-  assistant->priv = G_TYPE_INSTANCE_GET_PRIVATE (assistant, EKIGA_TYPE_ASSISTANT,
-                                                 EkigaAssistantPrivate);
+  assistant->priv = new EkigaAssistantPrivate;
 
   gtk_window_set_default_size (GTK_WINDOW (assistant), 500, 300);
   gtk_window_set_position (GTK_WINDOW (assistant), GTK_WIN_POS_CENTER);
@@ -1574,10 +1573,12 @@ ekiga_assistant_finalize (GObject *object)
 
   g_object_unref (assistant->priv->icon);
 
+  delete assistant->priv;
+  assistant->priv = NULL;
+
   G_OBJECT_CLASS (ekiga_assistant_parent_class)->finalize (object);
 }
 
-
 static void
 ekiga_assistant_class_init (EkigaAssistantClass *klass)
 {
@@ -1589,8 +1590,6 @@ ekiga_assistant_class_init (EkigaAssistantClass *klass)
   assistant_class->cancel = ekiga_assistant_cancel;
 
   object_class->finalize = ekiga_assistant_finalize;
-
-  g_type_class_add_private (klass, sizeof (EkigaAssistantPrivate));
 }
 
 



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