Skip to content

Commit

Permalink
Merge pull request #81 from guillerodriguez/robovm_leaks
Browse files Browse the repository at this point in the history
Close SQLite connection on termination.
  • Loading branch information
samskivert authored Apr 8, 2019
2 parents 52a3f35 + 7bf138d commit 7e7a9d0
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 @@ -181,6 +181,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 7e7a9d0

Please sign in to comment.