After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 97498 - Gtk::WindowGroup::create() is missing
Gtk::WindowGroup::create() is missing
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
2.0
Other All
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2002-11-02 18:05 UTC by Daniel Elstner
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the patch (2.33 KB, patch)
2002-11-02 18:06 UTC, Daniel Elstner
none Details | Review

Description Daniel Elstner 2002-11-02 18:05:11 UTC
Gtk::WindowGroup is a Glib::Object derived class and should therefore have
a static create() method that returns a Glib::RefPtr<>.  Right now,
create() is missing and the default ctor is public instead.  This is
dangerous; non-Gtk::Object classes should always be instantiated in free
storage since they use pure reference counting for memory management.

Attached is a patch that adds create() and makes the default ctor
protected.  Neither change breaks ABI:  create() is only an addition, and
the linker doesn't care about public/protected/private issues.  (I'm
absolutely sure about that -- I made diffs of the nm output, and gtkmm
itself used to redeclare methods in wrap_init.cc a while ago.)

What remains are policy issues.  I'll try to outline the pros and cons:

- con: The general policy used by GTK+ as well is that no API additions are
allowed in a stable branch.  This is done to avoid binary dependencies on a
specific micro version -- people might not realize they're using a function
that didn't exist in prior micro releases.

- pro: It's argueable that adding create() should be considered as API fix
rather than API addition.  Obvious API fixes are allowed even during a
freeze (e.g. I fixed a GLib function to use gssize rather than gsize after
the official API freeze in the 1.3 series).  In our case ABI compatibility
is also required, but that's no problem.

- con: Although unlikely, people might already use Gtk::WindowGroup.  While
compiled executables will continue to work, the source won't compile
anymore due to the Gtk::WindowGroup ctor being protected.

- pro: Instantiating Gtk::WindowGroup on stack is broken anyway.  I haven't
tested it, but if it should indeed not segfault it'll at least cause a
memory leak.

Opinions?

--Daniel
Comment 1 Daniel Elstner 2002-11-02 18:06:24 UTC
Created attachment 11989 [details] [review]
the patch
Comment 2 Murray Cumming 2002-11-02 21:52:47 UTC
OK, if it doesn't break binary ABI and the source API is unusable then
let's apply it.
Comment 3 Daniel Elstner 2002-11-03 18:09:43 UTC
Applied.