forked from AuroraMiddleware/gtk
places view: Avoid a crash in finalize
When the places view is finalized before the network loading is finished, the async operation is cancelled, and the callback accesses the places view while it is already in a state of disrepair. Avoid that access.
This commit is contained in:
parent
6a4e4a9fe8
commit
6064ed5181
@ -992,11 +992,8 @@ network_enumeration_finished (GObject *source_object,
|
||||
{
|
||||
GtkPlacesViewPrivate *priv;
|
||||
GFileEnumerator *enumerator;
|
||||
GtkPlacesView *view;
|
||||
GError *error;
|
||||
|
||||
view = GTK_PLACES_VIEW (user_data);
|
||||
priv = gtk_places_view_get_instance_private (view);
|
||||
error = NULL;
|
||||
enumerator = g_file_enumerate_children_finish (G_FILE (source_object), res, &error);
|
||||
|
||||
@ -1010,6 +1007,7 @@ network_enumeration_finished (GObject *source_object,
|
||||
}
|
||||
else
|
||||
{
|
||||
priv = gtk_places_view_get_instance_private (GTK_PLACES_VIEW (user_data));
|
||||
g_file_enumerator_next_files_async (enumerator,
|
||||
G_MAXINT32,
|
||||
G_PRIORITY_DEFAULT,
|
||||
|
Loading…
Reference in New Issue
Block a user