[glibmm] Glib::ObjectBase: Don't mention GtkObject in comments
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Glib::ObjectBase: Don't mention GtkObject in comments
- Date: Tue, 10 Oct 2017 14:02:22 +0000 (UTC)
commit 8269635a223c9c3996cad58f1eafa63c03788258
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Tue Oct 10 16:00:04 2017 +0200
Glib::ObjectBase: Don't mention GtkObject in comments
Don't mention GtkObject or gtk_object_destroy() in comments. They were
removed from gtk+ in gtk+3.
glib/glibmm/containerhandle_shared.h | 6 ++++--
glib/glibmm/objectbase.cc | 12 ++++++------
2 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/glib/glibmm/containerhandle_shared.h b/glib/glibmm/containerhandle_shared.h
index 425734c..e8bfd7b 100644
--- a/glib/glibmm/containerhandle_shared.h
+++ b/glib/glibmm/containerhandle_shared.h
@@ -84,7 +84,8 @@ struct TypeTraits
// be next to the objects that they use.
#ifdef GLIBMM_CAN_USE_DYNAMIC_CAST_IN_UNUSED_TEMPLATE_WITHOUT_DEFINITION
-/** Partial specialization for pointers to GtkObject instances.
+/** Partial specialization for pointers to GObject instances.
+ * The C++ type is not a Glib::RefPtr<>. It can be a gtkmm widget.
* @ingroup ContHelpers
*/
template <class T>
@@ -116,7 +117,8 @@ struct TypeTraits<T*>
// This confuse the SUN Forte compiler, so we ifdef it out:
#ifdef GLIBMM_HAVE_DISAMBIGUOUS_CONST_TEMPLATE_SPECIALIZATIONS
-/** Partial specialization for pointers to const GtkObject instances.
+/** Partial specialization for pointers to const GObject instances.
+ * The C++ type is not a Glib::RefPtr<>. It can be a gtkmm widget.
* @ingroup ContHelpers
*/
template <class T>
diff --git a/glib/glibmm/objectbase.cc b/glib/glibmm/objectbase.cc
index dad5fd5..9be57e7 100644
--- a/glib/glibmm/objectbase.cc
+++ b/glib/glibmm/objectbase.cc
@@ -279,9 +279,9 @@ ObjectBase::destroy_notify_callback_(void* data)
(void*)cppObject, (void*)cppObject->gobject_, G_OBJECT_TYPE_NAME(cppObject->gobject_));
#endif
- if (cppObject) // This will be 0 if the C++ destructor has already run.
+ if (cppObject) // This will be nullptr if the C++ destructor has already run.
{
- cppObject->destroy_notify_(); // Virtual - it does different things for GObject and GtkObject.
+ cppObject->destroy_notify_(); // Virtual - it does different things for Glib::ObjectBase and Gtk::Object.
}
}
@@ -290,13 +290,13 @@ ObjectBase::destroy_notify_()
{
// The C instance is about to be disposed, making it unusable. Now is a
// good time to delete the C++ wrapper of the C instance. There is no way
-// to force the disposal of the GObject (though GtkObject has
-// gtk_object_destroy()), So this is the *only* place where we delete the
-// C++ wrapper.
+// to force the disposal of the GObject (though Gtk::Object::destroy_notify_()
+// can call g_object_run_dispose()), so this is the *only* place where we delete
+// the C++ wrapper.
//
// This will only happen after the last unreference(), which will be done by
// the RefPtr<> destructor. There should be no way to access the wrapper or
-// the undobjecterlying instance after that, so it's OK to delete this.
+// the underlying object instance after that, so it's OK to delete this.
#ifdef GLIBMM_DEBUG_REFCOUNTING
g_warning("Glib::ObjectBase::destroy_notify_: gobject_ = %p", (void*)gobject_);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]