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 778535 - Using a placeholder in a Gtk::ListBox causes warnings on destruction
Using a placeholder in a Gtk::ListBox causes warnings on destruction
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on: 778617
Blocks:
 
 
Reported: 2017-02-12 16:04 UTC by James Legg
Modified: 2017-04-26 13:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case (588 bytes, text/x-csrc)
2017-02-12 16:04 UTC, James Legg
Details

Description James Legg 2017-02-12 16:04:09 UTC
Created attachment 345579 [details]
test case

In gtkmm 3.22.2, after using Gtk::ListBox::set_placeholder, destructing the placeholder widget followed by the parent ListBox causes this to be logged:
Gtk-CRITICAL **: gtk_container_remove: assertion 'GTK_IS_CONTAINER (container)' failed
Destructing the ListBox followed by the placeholder widget instead causes:
Gtk-WARNING **: Tried to remove non-child 0x17ea210
(the address may be different).

The attached test case reproduces one the Gtk-CRITICAL case, the other case can be reproduced by swapping lines 14 and 15.

These can be avoided by calling Gtk::ListBox::unset_placeholder before destroying the Gtk::ListBox or the placeholder widget, however I don't think that should be necessary as there is nothing equivalent required for the Gtk::ListBoxRow children, or the children of most other container widgets.
Comment 1 Kjell Ahlstedt 2017-02-14 17:35:18 UTC
I have filed gtk+ bug 778617.
Comment 2 Kjell Ahlstedt 2017-04-26 13:52:24 UTC
The gtk+ bug 778617 has been fixed in the master branch and the gtk-3-22 branch.
That fix fixes this bug, too. No more unexpected and unwanted messages from the
test case in comment 0.