GNOME Bugzilla – Bug 672572
Criticals when switching away from the panel before grid loaded
Last modified: 2012-08-22 13:31:14 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 ]
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.
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
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.
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.
Review of attachment 216108 [details] [review]: If it works as expected, looks good to me.
Attachment 216108 [details] pushed as 761f5f0 - background: always pass a cancellable down to I/O operations Yeah, it works...pushed to master, thanks.
*** Bug 653392 has been marked as a duplicate of this bug. ***