Skip to content

Commit 2016446

Browse files
authored
Fix memory leak after migrating to PathBuilder (JetBrains#2995)
[CMP-10098](https://youtrack.jetbrains.com/issue/CMP-10098) Fix memory leak after migrating to `PathBuilder` Found during work on alexzhirkevich/compottie#76 ## Testing Manually 😢 - currently we don't have a way to reliably check this ## Release Notes ### Fixes - Multiple Platforms - _(prerelease fix)_ Fix memory leak during mutating `Path` after migrating to skia m144
1 parent 077d3a5 commit 2016446

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

compose/ui/ui-graphics/src/skikoMain/kotlin/androidx/compose/ui/graphics/SkiaBackedPath.skiko.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ internal class SkiaBackedPath(
127127
private fun replacePath(path: SkPath) {
128128
// Keep the same SkPath instance alive so native callers can continue mutating it.
129129
internalSkiaPath.swap(path)
130+
path.close()
130131
materializedGenerationId = internalSkiaPath.generationId
131132
currentFillMode = internalSkiaPath.fillMode
132133
pathBuilder.close()

0 commit comments

Comments
 (0)