Merge lp:~gue5t/midori/addons-iter-invalidation into lp:midori
Status: | Merged |
---|---|
Approved by: | Paweł Forysiuk |
Approved revision: | 6703 |
Merged at revision: | 6885 |
Proposed branch: | lp:~gue5t/midori/addons-iter-invalidation |
Merge into: | lp:midori |
Diff against target: |
66 lines (+22/-2) 1 file modified
extensions/addons.c (+22/-2) |
To merge this branch: | bzr merge lp:~gue5t/midori/addons-iter-invalidation |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paweł Forysiuk | Approve | ||
Cris Dywan | needs-testing | Approve | |
Review via email: mp+220343@code.launchpad.net |
Commit message
Avoid bugs due to race condition in addons delete dialog
Description of the change
From the bug report comments:
It looks like addons is sloppy in keeping track of references to rows in its treeview, which is repopulated when it notices the filesystem changes (it notices this at most once per second). Thus, if you delete a script and then delete another without waiting a couple seconds in between, the second "delete?" dialog is interrupted by the filesystem change being noticed and loses its reference to the selected row.
This change uses a GtkTreeRowReference to catch changes to the GtkTreeView and avoids keeping the pointer to the element across a call to gtk_dialog_run, which invokes the main loop and may result in the element list being reconstructed and old elements being freed.
I like the approach. Presumably unit testing it isn't easy… has anyone else manually tested it? Volunteers step up!