Skip to content

Commit b24b74a

Browse files
brucemok8kikoso
authored andcommitted
Update RememberComposeBitmapDescriptor.kt
reverted pushing renderComposableToBitmapDescriptor call to IO thread as causing intermittent crash
1 parent e031504 commit b24b74a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

maps-compose/src/main/java/com/google/maps/android/compose/RememberComposeBitmapDescriptor.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ import androidx.core.graphics.applyCanvas
3333
import androidx.core.graphics.createBitmap
3434
import com.google.android.gms.maps.model.BitmapDescriptor
3535
import com.google.android.gms.maps.model.BitmapDescriptorFactory
36-
import kotlinx.coroutines.Dispatchers
37-
import kotlinx.coroutines.withContext
3836

3937
@MapsComposeExperimentalApi
4038
@Composable
@@ -65,9 +63,7 @@ public fun rememberComposeBitmapDescriptor(
6563
}
6664

6765
LaunchedEffect(*keys) {
68-
bitmapDescriptor = withContext(Dispatchers.IO) {
69-
renderComposableToBitmapDescriptor(composeView)
70-
}
66+
bitmapDescriptor = renderComposableToBitmapDescriptor(composeView)
7167
}
7268

7369
return bitmapDescriptor

0 commit comments

Comments
 (0)