Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / stable / src / gtkmm / dockbook.cpp
index a7470f9..62047f7 100644 (file)
@@ -6,6 +6,7 @@
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+**     Copyright (c) 2007 Chris Moore
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
@@ -38,6 +39,8 @@
 #include <gtkmm/eventbox.h>
 #include <gtkmm/menu.h>
 
+#include "general.h"
+
 #endif
 
 /* === U S I N G =========================================================== */
@@ -79,9 +82,7 @@ void
 DockBook::clear()
 {
        while(get_n_pages())
-       {
                remove(static_cast<Dockable&>(*get_nth_page(get_n_pages()-1)));
-       }
 }
 
 void
@@ -240,6 +241,7 @@ DockBook::tab_button_pressed(GdkEventButton* event, Dockable* dockable)
                return false;
 
        Gtk::Menu *tabmenu=manage(new class Gtk::Menu());
+       tabmenu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), tabmenu));
 
        tabmenu->items().push_back(
                Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("gtk-close"),