Add close() method to NewPipeDatabase

This commit is contained in:
TobiGr 2021-07-10 14:46:51 +02:00
parent 7c3f5a62c5
commit 9ca2691a2c
2 changed files with 12 additions and 1 deletions

View file

@ -51,4 +51,15 @@ public final class NewPipeDatabase {
throw new RuntimeException("Checkpoint was blocked from completing");
}
}
public static void close() {
if (databaseInstance != null) {
synchronized (NewPipeDatabase.class) {
if (databaseInstance != null) {
databaseInstance.close();
databaseInstance = null;
}
}
}
}
}