Skip to content

Commit 630e9ce

Browse files
authored
Couple of tiny improvements (#3014)
1 parent 0eb3436 commit 630e9ce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

maps-sdk/src/main/java/com/mapbox/maps/renderer/MapboxRenderThread.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,11 @@ internal class MapboxRenderThread : Choreographer.FrameCallback {
146146
private inline fun trace(sectionName: String, section: (() -> Unit)) {
147147
if (MapboxTracing.platformTracingEnabled) {
148148
Trace.beginSection("$MAPBOX_TRACE_ID: $sectionName")
149-
section.invoke()
150-
Trace.endSection()
149+
try {
150+
section.invoke()
151+
} finally {
152+
Trace.endSection()
153+
}
151154
} else {
152155
section.invoke()
153156
}

0 commit comments

Comments
 (0)