[gnote] Destroy main window after closure



commit dd4146e2e0de66926492d2b3e3076bfa78272234
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Mon Jul 29 00:07:59 2013 +0300

    Destroy main window after closure

 src/gnote.cpp |    5 +++--
 src/gnote.hpp |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/gnote.cpp b/src/gnote.cpp
index 758f7d7..9d89ac6 100644
--- a/src/gnote.cpp
+++ b/src/gnote.cpp
@@ -406,7 +406,7 @@ namespace gnote {
   MainWindow & Gnote::new_main_window()
   {
     NoteRecentChanges *win = new NoteRecentChanges(default_note_manager());
-    win->signal_hide().connect(sigc::mem_fun(*this, &Gnote::on_main_window_closed));
+    win->signal_hide().connect(boost::bind(sigc::mem_fun(*this, &Gnote::on_main_window_closed), win));
     add_window(*win);
     return *win;
   }
@@ -429,8 +429,9 @@ namespace gnote {
     return new_main_window();
   }
 
-  void Gnote::on_main_window_closed()
+  void Gnote::on_main_window_closed(Gtk::Window *win)
   {
+    delete win;
     // if background mode, we need to have a window, to prevent quit
     if(m_is_background && !Gtk::Window::list_toplevels().size()) {
       new_main_window();
diff --git a/src/gnote.hpp b/src/gnote.hpp
index f556e52..81ccedd 100644
--- a/src/gnote.hpp
+++ b/src/gnote.hpp
@@ -167,7 +167,7 @@ private:
   void common_init();
   void end_main(bool bus_aquired, bool name_acquired);
   void on_sync_dialog_response(int response_id);
-  void on_main_window_closed();
+  void on_main_window_closed(Gtk::Window*);
   void make_app_actions();
   void add_app_actions(const std::vector<Glib::RefPtr<Gio::SimpleAction> > & actions);
   void make_app_menu();


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