mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
fix memory leak from my ididcy; relationship w #19 needs investigation
This commit is contained in:
@@ -38,6 +38,8 @@ object PostProcessor {
|
||||
|
||||
// init
|
||||
if (!init) {
|
||||
init = true
|
||||
|
||||
batch = SpriteBatch()
|
||||
camera = OrthographicCamera(AppLoader.screenW.toFloat(), AppLoader.screenH.toFloat())
|
||||
camera.setToOrtho(true)
|
||||
@@ -115,6 +117,12 @@ object PostProcessor {
|
||||
}
|
||||
}
|
||||
catch (doNothing: NullPointerException) { }
|
||||
finally {
|
||||
// one-time call, caused by catching NPE before batch ends
|
||||
if (batch.isDrawing) {
|
||||
batch.end()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user