? a.out
? gtkmm_deprecate.patch
? remove.patch
? since.patch
? temp.patch
? temp.path
? test.cc
? MSVC_Net2003/gdkmm/gdkmmconfig.h
? MSVC_Net2003/gtkmm/gtkmmconfig.h
? examples/book/custom/Makefile
? examples/book/custom/Makefile.in
? examples/book/input/example
? examples/book/treeview/popup/Makefile
? examples/book/treeview/popup/Makefile.in
? examples/book/treeview/popup/example
? gtk/gtkmm/nm_output.txt
? pango/pangomm/renderer.cc
? pango/pangomm/renderer.h
? pango/pangomm/private/renderer_p.h
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkmm/ChangeLog,v
retrieving revision 1.346.2.13
diff -u -p -r1.346.2.13 ChangeLog
--- ChangeLog	20 Dec 2005 09:22:39 -0000	1.346.2.13
+++ ChangeLog	20 Dec 2005 13:05:16 -0000
@@ -1,3 +1,14 @@
+2005-12-20  Murray Cumming  <murrayc@murrayc.com>
+
+	* gtk/src/container.ccg:
+	* gtk/src/container.hg: Use custom_c_callback option 
+	with _WRAP_SIGNAL for the remove signal, so we can 
+	provide a custom signal callback (as well as the existing 
+	custom default signal callback). This allows us to 
+	check for already-deleted children in connected signal handler 
+	callbacks as well as the default signal handler. This should 
+	be a partial fix for bug #315874 from Philip Langdale.
+
 2.8.2:
 
 2005-12-14  Philip Langdale  <plangdale@vmware.com>
Index: gtk/src/container.ccg
===================================================================
RCS file: /cvs/gnome/gtkmm/gtk/src/container.ccg,v
retrieving revision 1.8
diff -u -p -r1.8 container.ccg
--- gtk/src/container.ccg	15 Mar 2004 00:26:00 -0000	1.8
+++ gtk/src/container.ccg	20 Dec 2005 13:05:16 -0000
@@ -43,13 +43,95 @@ void container_foreach_callback(GtkWidge
   }
 }
 
+
+//Copy of generated callback:
+void Container_signal_remove_callback_normal(GtkContainer* self, GtkWidget* p0,void* data)
+{
+  using namespace Gtk;
+  typedef sigc::slot< void,Widget* > SlotType;
+
+  // Do not try to call a signal on a disassociated wrapper.
+  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
+  {
+    try
+    {
+      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
+        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
+);
+    }
+    catch(...)
+    {
+      Glib::exception_handlers_invoke();
+    }
+  }
+}
+
+void Container_signal_remove_callback(GtkContainer* self, GtkWidget* p0, void* data)
+{
+  //GTKMM_LIFECYCLE
+
+#ifdef GLIBMM_DEBUG_REFCOUNTING
+  g_warning("Container_signal_remove_callback()");
+#endif
+
+  //Don't call wrap() on a GTK+ instance whose gtkmm instance has been deleted - just call the original C callback.
+  const bool gtkmm_child_already_deleted = Glib::_gobject_cppinstance_already_deleted((GObject*)p0);
+
+  if(!gtkmm_child_already_deleted)
+  {
+    //Call the regular, generated callback:
+    Container_signal_remove_callback_normal(self, p0, data);
+  }
+  else
+  {
+    //Do nothing.
+  }
+}
+
 } // anonymous namespace
 
 
 namespace Gtk
 {
 
-void Container_Class::remove_callback_custom(GtkContainer* self, GtkWidget* p0)
+//Copy of generated callback:
+void Container_Class::remove_callback_normal(GtkContainer* self, GtkWidget* p0)
+{
+  CppObjectType *const obj = dynamic_cast<CppObjectType*>(
+      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
+
+  // Non-gtkmmproc-generated custom classes implicitly call the default
+  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
+  // generated classes can use this optimisation, which avoids the unnecessary
+  // parameter conversions if there is no possibility of the virtual function
+  // being overridden:
+  if(obj && obj->is_derived_())
+  {
+    try // Trap C++ exceptions which would normally be lost because this is a C callback.
+    {
+      // Call the virtual member method, which derived classes might override.
+      obj->on_remove(Glib::wrap(p0)
+);
+    }
+    catch(...)
+    {
+      Glib::exception_handlers_invoke();
+    }
+  }
+  else
+  {
+    BaseClassType *const base = static_cast<BaseClassType*>(
+        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
+    );
+
+    // Call the original underlying C function:
+    if(base && base->remove)
+      (*base->remove)(self, p0);
+  }
+}
+
+//Custom hand-coded callback:
+void Container_Class::remove_callback(GtkContainer* self, GtkWidget* p0)
 {
   //GTKMM_LIFECYCLE
 
@@ -59,12 +141,12 @@ void Container_Class::remove_callback_cu
 #endif
   
   //Don't call wrap() on a GTK+ instance whose gtkmm instance has been deleted - just call the original C callback.
-  bool gtkmm_child_already_deleted = Glib::_gobject_cppinstance_already_deleted((GObject*)p0);
+  const bool gtkmm_child_already_deleted = Glib::_gobject_cppinstance_already_deleted((GObject*)p0);
 
   if(!gtkmm_child_already_deleted)
   {
     //Call the regular, generated callback:
-    Container_Class::remove_callback(self, p0);
+    Container_Class::remove_callback_normal(self, p0);
   }
   else
   {
Index: gtk/src/container.hg
===================================================================
RCS file: /cvs/gnome/gtkmm/gtk/src/container.hg,v
retrieving revision 1.9
diff -u -p -r1.9 container.hg
--- gtk/src/container.hg	18 Sep 2004 09:22:29 -0000	1.9
+++ gtk/src/container.hg	20 Dec 2005 13:05:16 -0000
@@ -161,7 +161,11 @@ public:
 
 
   _WRAP_SIGNAL(void add(Widget* widget), "add")
-  _WRAP_SIGNAL(void remove(Widget* widget), "remove")
+
+  //We use the optional custom_c_callback parameter with _WRAP_SIGNAL() here,
+  //so that we can write special code to check for deleted child widget parameters:
+  _WRAP_SIGNAL(void remove(Widget* widget), "remove", custom_c_callback)
+
   _WRAP_SIGNAL(void check_resize(), "check_resize")
   _WRAP_SIGNAL(void set_focus_child(Widget* widget), "set_focus_child")
 
@@ -190,26 +194,7 @@ dnl
     reinterpret_cast<GtkObjectClass*>(klass)->destroy = &destroy_callback;
   _SECTION(SECTION_PH_DEFAULT_SIGNAL_HANDLERS)
     static void destroy_callback(GtkObject* self);
-  _POP()
-#m4end
-
-#m4begin
-dnl// Hook in custom remove callback.
-dnl// It will use the generated callback.
-dnl
-  _PUSH(SECTION_PCC_CLASS_INIT_DEFAULT_SIGNAL_HANDLERS)
-    klass->remove = &remove_callback_custom;
-
-    if(G_OBJECT_CLASS_TYPE(klass) == Gtk::Container::get_type())
-    { 
-      //Remove the parent class's (GtkContainer) remove callback - it just prints a warning.
-      //This prevents that warning when people derive directly from Gtk::Container.
-      BaseClassType *const base = static_cast<BaseClassType*>( g_type_class_peek_parent(klass) );
-      base->remove = 0;
-    }
-                
-  _SECTION(SECTION_PH_DEFAULT_SIGNAL_HANDLERS)
-    static void remove_callback_custom(GtkContainer* self, GtkWidget* p0);
+    static void remove_callback_normal(GtkContainer* self, GtkWidget* p0);
   _POP()
 #m4end
 
Index: gtk/src/widget.hg
===================================================================
RCS file: /cvs/gnome/gtkmm/gtk/src/widget.hg,v
retrieving revision 1.35.2.1
diff -u -p -r1.35.2.1 widget.hg
--- gtk/src/widget.hg	29 Nov 2005 16:37:14 -0000	1.35.2.1
+++ gtk/src/widget.hg	20 Dec 2005 13:05:16 -0000
@@ -670,7 +670,7 @@ dnl
   _WRAP_SIGNAL(bool window_state_event(GdkEventWindowState* event), "window_state_event")
 
   //We use the optional custom_c_callback parameter with _WRAP_SIGNAL() for some of these,
-  //so that we can write special code to wrap the non-const SelectioData& output parameters:
+  //so that we can write special code to wrap the non-const SelectionData& output parameters:
   _WRAP_SIGNAL(void selection_get(SelectionData& selection_data, guint info, guint time), "selection_get", custom_c_callback)
   _WRAP_SIGNAL(void selection_received(const SelectionData& selection_data, guint time), "selection_received")
   
