~ubuntu-branches/ubuntu/precise/gwibber/precise-proposed-201206191543

« back to all changes in this revision

Viewing changes to debian/patches/lp_959068.patch

  • Committer: Package Import Robot
  • Author(s): Ken VanDine
  • Date: 2012-04-04 17:04:37 UTC
  • Revision ID: package-import@ubuntu.com-20120404170437-fpksbdyv4vafsw0h
Tags: 3.4.0-0ubuntu2
* debian/patches/lp_959068.patch
  - work around a bug in libgee which causes the size of a HashMap to 
    change if you call unset while iterating it, which invalidates 
    the iterator (LP: #959068)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
=== modified file 'libgwibber/streams.vala'
 
2
--- old/libgwibber/streams.vala 2012-03-19 13:35:30 +0000
 
3
+++ new/libgwibber/streams.vala 2012-04-04 20:53:49 +0000
 
4
@@ -213,13 +213,21 @@
 
5
                 model = create_model ();
 
6
               }
 
7
               model.row_removed.connect((_m, _i) => {
 
8
+                var to_remove = new GLib.List <string> ();
 
9
                 foreach (var v in seen.entries)
 
10
                 {
 
11
                   if (v.value == _i)
 
12
                   {
 
13
-                    seen.unset(v.key);
 
14
+                    /* defer calling unset until after we are done iterating 
 
15
+                     * the HashMap, it will resize making the iterator invalid
 
16
+                     * This is fixed in the 0.7 series of libgee
 
17
+                     * https://bugzilla.gnome.org/show_bug.cgi?id=671327
 
18
+                     */
 
19
+                    to_remove.prepend (v.key);
 
20
                   }
 
21
                 }
 
22
+                foreach (var v in to_remove)
 
23
+                  seen.unset(v);
 
24
               });
 
25
               Idle.add(() => {
 
26
                 refresh_model_async.begin ();
 
27