Bug 859434 - Close thumbnail cursor in TopSitesView r=lucasr a=bajaj
authorMark Finkle <mfinkle@mozilla.com>
Mon, 08 Apr 2013 15:43:19 -0400
changeset 132571 4a3af6adb8d3280c28377ec555120ca1a72bcce7
parent 132570 565c52f0f8c35c265000fe8a54299a226505dfa2
child 132572 e9a9918f8c760da930b3208d0c1bea33c7fe3b23
push id2349
push usermfinkle@mozilla.com
push dateTue, 09 Apr 2013 21:40:54 +0000
treeherdermozilla-beta@f2e3a0d44669 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr, bajaj
bugs859434
milestone21.0
Bug 859434 - Close thumbnail cursor in TopSitesView r=lucasr a=bajaj
mobile/android/base/AboutHomeContent.java
--- a/mobile/android/base/AboutHomeContent.java
+++ b/mobile/android/base/AboutHomeContent.java
@@ -1063,21 +1063,23 @@ public class AboutHomeContent extends Sc
                         urls.add(holder.getUrl());
 
                         Cursor c = BrowserDB.getThumbnailsForUrls(resolver, urls);
                         if (c == null || !c.moveToFirst()) {
                             return null;
                         }
 
                         final byte[] b = c.getBlob(c.getColumnIndexOrThrow(Thumbnails.DATA));
+                        Bitmap bitmap = null;
                         if (b != null) {
-                            return BitmapFactory.decodeByteArray(b, 0, b.length);
+                            bitmap = BitmapFactory.decodeByteArray(b, 0, b.length);
                         }
+                        c.close();
 
-                        return null;
+                        return bitmap;
                     }
 
                     @Override
                     public void onPostExecute(Bitmap b) {
                         displayThumbnail(v, b);
                     }
                 }).execute();
             }