Skip to content

Commit

Permalink
Close SQLite connection on termination.
Browse files Browse the repository at this point in the history
  • Loading branch information
guillerodriguez committed Apr 2, 2019
1 parent 824be6f commit 7bf138d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions robovm/src/playn/robovm/RoboPlatform.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ void didEnterBackground () {

void willTerminate () {
pool.shutdown();
storage.close();
// let the app know that we're terminating
dispatchEvent(lifecycle, Lifecycle.EXIT);
}
Expand Down
8 changes: 8 additions & 0 deletions robovm/src/playn/robovm/RoboStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,12 @@ public Batch startBatch() {
// SQL commands are already pretty fast, so it might not be necessary
return new BatchImpl(this);
}

void close() {
try {
conn.close();
} catch (SQLException sqe) {
// Not much to do here
}
}
}

0 comments on commit 7bf138d

Please sign in to comment.