[ekiga] Manage the assistant window using a smart pointer in the gtk+ frontend



commit 0e9adbde4b178bf4817b701c878ac0c60dd342a3
Author: Julien Puydt <jpuydt free fr>
Date:   Wed Jun 19 17:38:57 2013 +0200

    Manage the assistant window using a smart pointer in the gtk+ frontend

 lib/engine/gui/gtk-frontend/gtk-frontend.cpp |    9 +++++----
 lib/engine/gui/gtk-frontend/gtk-frontend.h   |    2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/lib/engine/gui/gtk-frontend/gtk-frontend.cpp b/lib/engine/gui/gtk-frontend/gtk-frontend.cpp
index 163dd1b..7fe978c 100644
--- a/lib/engine/gui/gtk-frontend/gtk-frontend.cpp
+++ b/lib/engine/gui/gtk-frontend/gtk-frontend.cpp
@@ -95,7 +95,6 @@ GtkFrontend::~GtkFrontend ()
   // code should be reworked for a correct memory
   // management
 
-  //gtk_widget_destroy (assistant_window);
   //if (status_icon)
   //  g_object_unref (status_icon);
   //gtk_widget_destroy (main_window);
@@ -117,7 +116,9 @@ void GtkFrontend::build ()
   accounts_window =
     boost::shared_ptr<GtkWidget> (accounts_window_new_with_key (core, "/apps/" PACKAGE_NAME 
"/general/user_interface/accounts_window"),
                                  gtk_widget_destroy);
-  assistant_window = ekiga_assistant_new (core);
+  assistant_window =
+    boost::shared_ptr<GtkWidget> (ekiga_assistant_new (core),
+                                 gtk_widget_destroy);
   call_window =
     boost::shared_ptr<GtkWidget> (call_window_new (core),
                                  gtk_widget_destroy);
@@ -127,7 +128,7 @@ void GtkFrontend::build ()
   preferences_window = preferences_window_new (core);
   status_icon = status_icon_new (core);
   main_window = gm_main_window_new (core);
-  gtk_window_set_transient_for (GTK_WINDOW (assistant_window), GTK_WINDOW (main_window));
+  gtk_window_set_transient_for (GTK_WINDOW (assistant_window.get ()), GTK_WINDOW (main_window));
 }
 
 
@@ -145,7 +146,7 @@ const std::string GtkFrontend::get_description () const
 const GtkWidget*
 GtkFrontend::get_assistant_window () const
 {
-  return assistant_window;
+  return assistant_window.get ();
 }
 
 const GtkWidget*
diff --git a/lib/engine/gui/gtk-frontend/gtk-frontend.h b/lib/engine/gui/gtk-frontend/gtk-frontend.h
index 4552d71..da373a1 100644
--- a/lib/engine/gui/gtk-frontend/gtk-frontend.h
+++ b/lib/engine/gui/gtk-frontend/gtk-frontend.h
@@ -81,7 +81,7 @@ public:
 
 private :
 
-  GtkWidget* assistant_window;
+  boost::shared_ptr<GtkWidget> assistant_window;
   GtkWidget* main_window;
   GtkWidget *preferences_window;
   boost::shared_ptr<GtkWidget> addressbook_window;


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