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 776012 - GtkFlowBox, GtkListBox: Don't emit selected-rows-changed, selected-children-changed, etc. during destruction
GtkFlowBox, GtkListBox: Don't emit selected-rows-changed, selected-children-c...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.22.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 774914
 
 
Reported: 2016-12-12 20:11 UTC by Debarshi Ray
Modified: 2017-01-12 15:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample program for GtkFlowBox (1016 bytes, text/x-csrc)
2016-12-12 20:11 UTC, Debarshi Ray
  Details
flowbox: Don't emit selected-children-changed during destruction (852 bytes, patch)
2016-12-12 20:14 UTC, Debarshi Ray
committed Details | Review
listbox: Don't emit selected-rows-changed, etc. during destruction (894 bytes, patch)
2016-12-18 08:46 UTC, Debarshi Ray
committed Details | Review
Sample program for GtkListBox (1000 bytes, text/x-csrc)
2016-12-18 08:48 UTC, Debarshi Ray
  Details

Description Debarshi Ray 2016-12-12 20:11:20 UTC
Created attachment 341843 [details]
Sample program for GtkFlowBox

GtkFlowBox emits selected-children-changed during destruction. This can be problematic. Imagine a MyFlowBox that updates itself during selected-children-changed. During destruction the innards of the class won't be usable and the signal handler has to be explicitly disconnected.
Comment 1 Debarshi Ray 2016-12-12 20:14:20 UTC
Created attachment 341844 [details] [review]
flowbox: Don't emit selected-children-changed during destruction
Comment 2 Matthias Clasen 2016-12-17 13:54:45 UTC
Review of attachment 341844 [details] [review]:

Does listbox do the same ? Does treeview ? This feels like something that we should have a general policy about. Absent one, it seems the right thing to do.
Comment 3 Debarshi Ray 2016-12-17 21:58:03 UTC
From reading gtk/gtklistbox.c and various code that uses it, I do think GtkListBox also has the same problem. However, I am still in GtkFlowBox-land in terms of libgd, so I haven't gotten to GtkListBox yet.

I don't know about GtkTreeView.

In the past, we have at least fixed GtkStack (bug 749012 and bug 724506) in a similar way.
Comment 4 Debarshi Ray 2016-12-18 08:46:57 UTC
Created attachment 342153 [details] [review]
listbox: Don't emit selected-rows-changed, etc. during destruction
Comment 5 Debarshi Ray 2016-12-18 08:48:11 UTC
Created attachment 342154 [details]
Sample program for GtkListBox
Comment 6 Matthias Clasen 2016-12-19 15:50:39 UTC
Review of attachment 341844 [details] [review]:

.
Comment 7 Matthias Clasen 2016-12-19 15:50:57 UTC
Review of attachment 342153 [details] [review]:

.
Comment 8 Debarshi Ray 2016-12-19 17:07:12 UTC
Comment on attachment 341844 [details] [review]
flowbox: Don't emit selected-children-changed during destruction

Pushed to both master and gtk-3-22.
Comment 9 Debarshi Ray 2016-12-19 17:07:32 UTC
Comment on attachment 342153 [details] [review]
listbox: Don't emit selected-rows-changed, etc. during destruction

Pushed to both master and gtk-3-22.