浏览代码

Close cursors in UploadStorageManager methods

masensio 9 年之前
父节点
当前提交
aeaa422fed
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      src/com/owncloud/android/datamodel/UploadsStorageManager.java

+ 13 - 0
src/com/owncloud/android/datamodel/UploadsStorageManager.java

@@ -186,8 +186,13 @@ public class UploadsStorageManager extends Observable {
             } else {
                 Log_OC.e(TAG, "Failed to update upload db.");
             }
+
+            c.close();
+
             return r;
         }
+
+        c.close();
         return 0;
     }
     /**
@@ -212,6 +217,9 @@ public class UploadsStorageManager extends Observable {
         if (c.getCount() != 1) {
             Log_OC.e(TAG, c.getCount() + " items for path=" + filepath
                     + " available in UploadDb. Expected 1. Failed to update upload db.");
+
+            c.close();
+
             return 0;
         }
         return updateUploadInternal(c, status, result);
@@ -278,6 +286,9 @@ public class UploadsStorageManager extends Observable {
                 }
             } while (c.moveToNext());
         }
+
+        c.close();
+
         return list;
     }
 
@@ -295,6 +306,8 @@ public class UploadsStorageManager extends Observable {
             file = createFileInstance(c);
         }
 
+        c.close();
+
         return file;
     }