mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-24 17:52:17 -05:00
DatabaseBackend bugfixes
Don't leak cursors, initially create tables
This commit is contained in:
parent
299bbdf27f
commit
9e07fc5651
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user