Skip to content

Commit

Permalink
Clear elevation model cache only when Activity paused. Do not clear i…
Browse files Browse the repository at this point in the history
…t on GL context lost.
  • Loading branch information
EMaksymenko committed Jan 12, 2025
1 parent 4dd75f3 commit e51cffc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@ open class WorldWindow : GLSurfaceView, FrameCallback, GLSurfaceView.Renderer {
// whether the render resources are valid, so we reset and let the GLSurfaceView establish the new
// EGL context and viewport.
reset()

// Invalidate elevation model cache to free memory when application is not used
engine.globe.elevationModel.invalidate()
}

override fun onAttachedToWindow() {
Expand Down
3 changes: 0 additions & 3 deletions worldwind/src/commonMain/kotlin/earth/worldwind/WorldWind.kt
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ open class WorldWind @JvmOverloads constructor(
// Clear the render resource cache; it's entries are now invalid.
renderResourceCache.clear()

// Invalidate elevation model.
globe.elevationModel.invalidate()

// Clear the viewport dimensions.
viewport.setEmpty()

Expand Down

0 comments on commit e51cffc

Please # to comment.