[ekiga] Manage the chat window through a smart pointer in the gtk+ frontend



commit ac1d58a821058fd160868928a965631073266982
Author: Julien Puydt <jpuydt free fr>
Date:   Wed Jun 19 08:37:22 2013 +0200

    Manage the chat window through a smart pointer in the gtk+ frontend

 lib/engine/gui/gtk-frontend/gtk-frontend.cpp |    7 ++++---
 lib/engine/gui/gtk-frontend/gtk-frontend.h   |    2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/lib/engine/gui/gtk-frontend/gtk-frontend.cpp b/lib/engine/gui/gtk-frontend/gtk-frontend.cpp
index 49f1a78..3c872d5 100644
--- a/lib/engine/gui/gtk-frontend/gtk-frontend.cpp
+++ b/lib/engine/gui/gtk-frontend/gtk-frontend.cpp
@@ -96,7 +96,6 @@ GtkFrontend::~GtkFrontend ()
   // management
 
   //gtk_widget_destroy (assistant_window);
-  //gtk_widget_destroy (chat_window);
   //gtk_widget_destroy (call_window);
   //if (status_icon)
   //  g_object_unref (status_icon);
@@ -121,7 +120,9 @@ void GtkFrontend::build ()
                                  gtk_widget_destroy);
   assistant_window = ekiga_assistant_new (core);
   call_window = call_window_new (core);
-  chat_window = chat_window_new (core, "/apps/" PACKAGE_NAME "/general/user_interface/chat_window");
+  chat_window =
+    boost::shared_ptr<GtkWidget> (chat_window_new (core, "/apps/" PACKAGE_NAME 
"/general/user_interface/chat_window"),
+                                 gtk_widget_destroy);
   preferences_window = preferences_window_new (core);
   status_icon = status_icon_new (core);
   main_window = gm_main_window_new (core);
@@ -179,7 +180,7 @@ const GtkWidget *GtkFrontend::get_call_window () const
 
 const GtkWidget *GtkFrontend::get_chat_window () const
 {
-  return chat_window;
+  return chat_window.get ();
 }
 
 
diff --git a/lib/engine/gui/gtk-frontend/gtk-frontend.h b/lib/engine/gui/gtk-frontend/gtk-frontend.h
index fd65fa0..a9f1e4f 100644
--- a/lib/engine/gui/gtk-frontend/gtk-frontend.h
+++ b/lib/engine/gui/gtk-frontend/gtk-frontend.h
@@ -87,7 +87,7 @@ private :
   boost::shared_ptr<GtkWidget> addressbook_window;
   boost::shared_ptr<GtkWidget> accounts_window;
   GtkWidget *call_window;
-  GtkWidget *chat_window;
+  boost::shared_ptr<GtkWidget> chat_window;
   StatusIcon *status_icon;
 
   Ekiga::ServiceCore & core;


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