aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs
diff options
context:
space:
mode:
authorAndreas Straub <andy@strb.org>2015-06-29 13:40:56 +0200
committerAndreas Straub <andy@strb.org>2015-07-19 21:32:26 +0200
commit9e07fc5651015dc60e54bcb2f796d0f932d5f925 (patch)
treee90b6b992dbfa3e5be124e48e830249871569387 /src/main/java/eu/siacs
parent299bbdf27f0144e6eed99e70a3b2e46f9a3aa301 (diff)
DatabaseBackend bugfixes
Don't leak cursors, initially create tables
Diffstat (limited to 'src/main/java/eu/siacs')
-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 ee6c76368..966734bae 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;
}