mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-06 08:38:30 +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
|
// init
|
||||||
if (!init) {
|
if (!init) {
|
||||||
|
init = true
|
||||||
|
|
||||||
batch = SpriteBatch()
|
batch = SpriteBatch()
|
||||||
camera = OrthographicCamera(AppLoader.screenW.toFloat(), AppLoader.screenH.toFloat())
|
camera = OrthographicCamera(AppLoader.screenW.toFloat(), AppLoader.screenH.toFloat())
|
||||||
camera.setToOrtho(true)
|
camera.setToOrtho(true)
|
||||||
@@ -115,6 +117,12 @@ object PostProcessor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (doNothing: NullPointerException) { }
|
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