Merge branch 'fix/close-db-file' into 'main'

Fix database file not being closed when leaving the world

See merge request jeseibel/distant-horizons-core!31
This commit is contained in:
James Seibel
2023-10-20 03:15:22 +00:00
3 changed files with 6 additions and 1 deletions
@@ -550,6 +550,9 @@ public class FullDataFileHandler implements IFullDataSourceProvider
//=========//
@Override
public void close() { FullDataMetaFile.checkAndLogPhantomDataSourceLifeCycles(); }
public void close() {
FullDataMetaFile.checkAndLogPhantomDataSourceLifeCycles();
this.fullDataRepo.close();
}
}
@@ -313,6 +313,7 @@ public class RenderSourceFileHandler implements IRenderSourceProvider
LOGGER.info("Closing " + this.getClass().getSimpleName() + " with [" + this.loadedMetaFileBySectionPos.size() + "] files...");
this.fileHandlerThreadPool.shutdown();
this.threadPoolMsg.close();
this.renderDataRepo.close();
}
public void deleteRenderCache()
@@ -282,6 +282,7 @@ public abstract class AbstractDhRepo<TDTO extends IBaseDTO>
{
if(this.connection != null)
{
CONNECTIONS_BY_CONNECTION_STRING.remove(this.connectionString);
this.connection.close();
}
ACTIVE_CONNECTION_STRINGS_BY_REPO.remove(this);