Merge lp:~jeremywootten/pantheon-files/fix-1665620-crash-on-reload-close-tab into lp:~elementary-apps/pantheon-files/trunk

Proposed by Jeremy Wootten
Status: Merged
Approved by: Cody Garver
Approved revision: 2500
Merged at revision: 2500
Proposed branch: lp:~jeremywootten/pantheon-files/fix-1665620-crash-on-reload-close-tab
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 22 lines (+3/-3)
1 file modified
libcore/gof-directory-async.vala (+3/-3)
To merge this branch: bzr merge lp:~jeremywootten/pantheon-files/fix-1665620-crash-on-reload-close-tab
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+317611@code.launchpad.net

Commit message

Add toggle ref to the GOFDirectoryAsync on creation instead of after initialization, preventing a crash introduced in r2474

Description of the change

This branch fixes regression caused by r2474. The toggle ref is added to the GOFDirectoryAsync on creation instead of after initialization (as before r2474) so only one toggle can be added, even if the view is reloaded.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libcore/gof-directory-async.vala'
2--- libcore/gof-directory-async.vala 2017-02-12 10:29:05 +0000
3+++ libcore/gof-directory-async.vala 2017-02-17 12:46:35 +0000
4@@ -145,6 +145,9 @@
5 cancellable.cancel ();
6 cancellable = new Cancellable ();
7
8+ this.add_toggle_ref ((ToggleNotify) toggle_ref_notify);
9+ this.unref ();
10+
11 /* If we already have a loaded file cache just list them */
12 if (previous_state == State.LOADED) {
13 list_cached_files (file_loaded_func);
14@@ -358,9 +361,6 @@
15 directory_cache.insert (location.dup (), this);
16 dir_cache_lock.unlock ();
17
18- this.add_toggle_ref ((ToggleNotify) toggle_ref_notify);
19- this.unref ();
20-
21 is_ready = true;
22 yield list_directory_async (file_loaded_func);
23

Subscribers

People subscribed via source and target branches

to all changes: