Skip to content

Commit 1fd6d96

Browse files
pengdevgithub-actions[bot]
authored andcommitted
guard GlobeCustomLayerHost.deinitialize() against uninitialized state
deinitialize() can be called without initialize() when using the Vulkan backend since custom layers are not supported. Check lateinit property before accessing to prevent crash. GitOrigin-RevId: e1f9867645af1196aa40ce0099e0343fbe702f47
1 parent 0db2666 commit 1fd6d96

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/src/main/java/com/mapbox/maps/testapp/examples/customlayer/globe/GlobeCustomLayerHost.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ class GlobeCustomLayerHost(
389389
override fun contextLost() = logW(TAG, "contextLost")
390390

391391
override fun deinitialize() {
392+
if (!::globeProgram.isInitialized) return
392393
globeProgram.deinitialize()
393394
simpleProgram.deinitialize()
394395
glDeleteBuffers(vbo.buffer.size, vbo.buffer, 0)

0 commit comments

Comments
 (0)