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 672572 - Criticals when switching away from the panel before grid loaded
Criticals when switching away from the panel before grid loaded
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Background
3.3.x
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
: 653392 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-03-21 17:04 UTC by Cosimo Cecchi
Modified: 2012-08-22 13:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
backgrounds: hold a ref on BgPicturesSource while doing async work (2.02 KB, patch)
2012-04-20 15:23 UTC, Cosimo Cecchi
rejected Details | Review
background: always pass a cancellable down to I/O operations (4.45 KB, patch)
2012-06-11 13:04 UTC, Cosimo Cecchi
committed Details | Review

Description Cosimo Cecchi 2012-03-21 17:04:25 UTC
If you press the "All settings" button before the grid view of the Background panel is loaded, you will get a ton of GTK criticals.


(gnome-control-center:4869): GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' in cast to `BgPicturesSource'

(gnome-control-center:4869): GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' in cast to `BgSource'

(gnome-control-center:4869): background-cc-panel-CRITICAL **: bg_source_get_liststore: assertion `BG_IS_SOURCE (source)' failed

(gnome-control-center:4869): Gtk-CRITICAL **: gtk_list_store_insert_with_values: assertion `GTK_IS_LIST_STORE (list_store)' failed

[ ... there's really a lot of them ]
Comment 1 Cosimo Cecchi 2012-04-20 15:23:01 UTC
Created attachment 212430 [details] [review]
backgrounds: hold a ref on BgPicturesSource while doing async work

Otherwise, in case BgPicturesSource is unreffed during the async
operation (e.g. because the user switched to another panel), we might
not have a valid reference anymore in the callback.
Comment 2 Cosimo Cecchi 2012-04-20 15:23:59 UTC
The following traces might also be related to this:

https://bugzilla.gnome.org/show_bug.cgi?id=672918
https://bugzilla.gnome.org/show_bug.cgi?id=653392
Comment 3 Bastien Nocera 2012-06-06 15:33:45 UTC
Review of attachment 212430 [details] [review]:

Pretty certain I had reviewed that. I would rather the operations were cancelled as soon at the same time as BgPicturesSource is unref'ed.
Comment 4 Cosimo Cecchi 2012-06-11 13:04:25 UTC
Created attachment 216108 [details] [review]
background: always pass a cancellable down to I/O operations

I still like more the approach of holding a ref to self while doing async work, but here is another patch that just passes down a GCancellable. We have to be careful about the point where we cast the callback payload back, since in case the panel is disposed while loading, user_data will not be a valid BgPicturesSource anymore in the callback.
Comment 5 Bastien Nocera 2012-06-11 13:08:16 UTC
Review of attachment 216108 [details] [review]:

If it works as expected, looks good to me.
Comment 6 Cosimo Cecchi 2012-06-11 13:17:28 UTC
Attachment 216108 [details] pushed as 761f5f0 - background: always pass a cancellable down to I/O operations

Yeah, it works...pushed to master, thanks.
Comment 7 Bastien Nocera 2012-08-22 13:31:14 UTC
*** Bug 653392 has been marked as a duplicate of this bug. ***