aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorAndreas Straub <andy@strb.org>2015-06-29 13:40:56 +0200
committerAndreas Straub <andy@strb.org>2015-07-05 17:26:29 +0200
commit71c0a75ec9ace910e63707e95863a86742b553bf (patch)
treebd93827c8f03b5883e8dae87da976a3b98cbc481 /src/main
parent0423852cb8a3c22978aed3c5b88d18de5797010e (diff)
DatabaseBackend bugfixes
Don't leak cursors, initially create tables
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java
index ee6c7636..966734ba 100644
--- a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java
+++ b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java
@@ -123,6 +123,9 @@ public class DatabaseBackend extends SQLiteOpenHelper {
+ ") ON DELETE CASCADE);");
db.execSQL(CREATE_CONTATCS_STATEMENT);
+ db.execSQL(CREATE_SESSIONS_STATEMENT);
+ db.execSQL(CREATE_PREKEYS_STATEMENT);
+ db.execSQL(CREATE_SIGNED_PREKEYS_STATEMENT);
}
@Override
@@ -563,6 +566,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
try {
session = new SessionRecord(Base64.decode(cursor.getString(cursor.getColumnIndex(AxolotlService.SQLiteAxolotlStore.KEY)),Base64.DEFAULT));
} catch (IOException e) {
+ cursor.close();
throw new AssertionError(e);
}
}
@@ -751,6 +755,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
} catch (IOException ignored) {
}
}
+ cursor.close();
return prekeys;
}