Commit 719d3d8
authored
fix: nullPointerException in GroupView when drawing bitmap on Android 10 and older (#2694)
# Summary
Open Issue: [isRecycled() on a null object
reference](#2609)
This PR addresses a sporadic crash that occurs specifically on Android
10 (API 29) and older when rendering SVGs.
* Although the code already handles the mLayerBitmap being null in an
earlier section, the bitmap can still become null on Android 10 and
below due to memory pressure or race conditions, ultimately leading to a
crash.
* Differences in how Bitmap memory handled and Canvas drawing operations
are handled in these versions, make them more susceptible to this
issue.)
[Reference: Android Bitmap Memory
Management](https://developer.android.com/topic/performance/graphics/manage-memory#recycle)
## Test Plan
Unfortunately, it is bit hard to recreate this behaviour and it is very
sporadic.
I have patched this change in my app, and it has produced positive
results. both for me and for some other users as well.
(#2609 (comment))
### What's required for testing (prerequisites)?
-
### What are the steps to reproduce (after prerequisites)?
-
## Compatibility
| OS | Implemented |
| ------- | :---------: |
| iOS | ❌ |
| MacOS | ❌ |
| Android | ✅ |
| Web | ❌ |1 parent 417b34e commit 719d3d8
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| |||
0 commit comments