Is g_object_unref required for gobjects created with gtkmm?

Some GTK methods documented as:

The caller of the function takes ownership of the data, and is responsible for freeing it.

It means I must use g_object_ref and g_object_unref in my app.
But what about gtkmm - as understand, it may do this automatically, but not sure.

Well, I found this gtkmm documentation page:
https://gnome.pages.gitlab.gnome.org/gtkmm-documentation/chapter-memory.html

Much of the reference documentation of glibmm and gtkmm is automatically “translated”
from C to C++. The “translation” is far from intelligent. You can usually
ignore what’s said about ownership. Where the gtkmm/glibmm documentation says
NULL or nullptr, it often means “an empty string” or “an empty Glib::RefPtr”.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.