This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: solve memory crashes

+4 -3
+2 -2
posedetection/src/iosMain/kotlin/com/performancecoachlab/posedetection/camera/CameraEngine.kt
··· 376 376 private val scope = CoroutineScope(Job() + Dispatchers.Main) 377 377 378 378 @OptIn(ExperimentalForeignApi::class) 379 - private var imageBuffer: CIImage? = null 380 379 private var frameProcessor = FrameProcessor() 381 380 382 381 @OptIn(ExperimentalForeignApi::class, NativeRuntimeApi::class) ··· 388 387 val timestamp = timeStamp() 389 388 if (isProcessing.compareAndSet(expect = false, update = true)) { 390 389 try { 390 + kotlin.native.runtime.GC.collect() 391 391 val result = runCatching { 392 392 393 393 val buffer = CMSampleBufferGetImageBuffer(didOutputSampleBuffer) ··· 430 430 println("Error during frame processing: ${e.message}") 431 431 }finally { 432 432 isProcessing.value = false 433 - kotlin.native.runtime.GC.collect() 433 + //kotlin.native.runtime.GC.collect() 434 434 } 435 435 } 436 436 }
+2 -1
posedetection/src/iosMain/kotlin/com/performancecoachlab/posedetection/camera/CameraView.ios.kt
··· 38 38 cameraEngine.value = engine.also { if (!frontCamera) it.toggleCameraLens() } 39 39 }) 40 40 if (drawSkeleton) { 41 + kotlin.native.runtime.GC.collect() 41 42 frameBitmap?.also { 42 43 Image( 43 44 bitmap = it, ··· 45 46 modifier = Modifier.fillMaxSize(), 46 47 contentScale = ContentScale.Crop, 47 48 ) 48 - kotlin.native.runtime.GC.collect() 49 + //kotlin.native.runtime.GC.collect() 49 50 } 50 51 } 51 52