diff --git a/gtk/src/widget.ccg b/gtk/src/widget.ccg
index ba53ce8..ea9f108 100644
--- a/gtk/src/widget.ccg
+++ b/gtk/src/widget.ccg
@@ -563,11 +563,11 @@ void Widget_Class::dispose_vfunc_callback(GObject* self)
 {
   //Avoid disposal. See also Window_Class::dispose_vfunc_callback().
 
-  #ifdef GLIBMM_DEBUG_REFCOUNTING
+  //#ifdef GLIBMM_DEBUG_REFCOUNTING
   g_warning("Widget_Class::dispose_vfunc_callback(): gobject_: %p\n", (void*)self);
   //if(self)
    //g_warning("  gtypename: %s\n", G_OBJECT_TYPE_NAME(self));
-  #endif
+  //#endif
 
   Widget *const obj = dynamic_cast<Widget*>(
       Glib::ObjectBase::_get_current_wrapper(self));
@@ -599,15 +599,24 @@ void Widget_Class::dispose_vfunc_callback(GObject* self)
         // non-managed objects here, the container just releases the
         // reference it has acquired before in gtk_container_add().
 
-        #ifdef GLIBMM_DEBUG_REFCOUNTING
-        g_warning("Widget_Class::dispose_vfunc_callback(): removing gobject_: %p from parent: %p", (void*)self, (void*)parent);
-        #endif
-
-        gtk_container_remove(GTK_CONTAINER(parent), pWidget);
-
-        #ifdef GLIBMM_DEBUG_REFCOUNTING
-        g_warning("Widget_Class::dispose_vfunc_callback(): after removing from parent.");
-        #endif
+        if(!GTK_IS_BIN(parent) || (gtk_bin_get_child(GTK_BIN(parent)) == pWidget)) //gtk_window_set_titlebar() sets its parent without making it the parent's child.
+        {
+          //#ifdef GLIBMM_DEBUG_REFCOUNTING
+          g_warning("Widget_Class::dispose_vfunc_callback(): removing gobject_: %p from parent: %p", (void*)self, (void*)parent);
+          //#endif
+
+          gtk_container_remove(GTK_CONTAINER(parent), pWidget);
+
+          #ifdef GLIBMM_DEBUG_REFCOUNTING
+          g_warning("Widget_Class::dispose_vfunc_callback(): after removing from parent.");
+          #endif
+        }
+        else
+        {
+          //#ifdef GLIBMM_DEBUG_REFCOUNTING
+          g_warning("Widget_Class::dispose_vfunc_callback(): not removing a non-child from a GtkBin.");
+          //#endif
+        }
       }
       // Special case for GtkMenu because gtk_menu_attach_to_widget does
       // not set widget->parent but gtk_menu_item_destroy() destroys the menu
