Skip to content

fix(android): port VMI dispose and Handler fixes to the legacy backend#333

Merged
mfazekas merged 2 commits into
feat/rive-ios-experimentalfrom
fix/legacy-vmi-dispose-handler
Jul 14, 2026
Merged

fix(android): port VMI dispose and Handler fixes to the legacy backend#333
mfazekas merged 2 commits into
feat/rive-ios-experimentalfrom
fix/legacy-vmi-dispose-handler

Conversation

@mfazekas

Copy link
Copy Markdown
Collaborator

Ports 6e55131 and 84e6d26 from PR #331 (android/src/main) to the legacy copy of RiveReactNativeView.kt: clear the lastKnownViewModelInstance snapshot on the disposing detach and resolve null from the main-thread read once willDispose is set, so post-dispose reads return null instead of a released instance; and reuse a cached main-thread Handler instead of allocating one per off-main getViewModelInstance() call. The file is now byte-identical to main's fixed copy.

mfazekas added 2 commits July 13, 2026 08:27
…(legacy)

Port of 6e55131 from android/src/main: lastKnownViewModelInstance survived
dispose, so a JS caller still holding the view ref got the retained,
already-released instance back (first property access throws "Cannot
acquire a disposed object") instead of null. Clear it on the disposing
detach, and resolve null from the main-thread read once willDispose is set
so a refresh posted before dispose can't re-cache a released instance
afterwards.
…hes (legacy)

Port of 84e6d26 from android/src/main: the async hook's ref path polls
getViewModelInstance() every 50ms; allocating a Handler per off-main call
was avoidable churn.
@mfazekas
mfazekas merged commit fc8f84f into feat/rive-ios-experimental Jul 14, 2026
21 of 22 checks passed
@mfazekas
mfazekas deleted the fix/legacy-vmi-dispose-handler branch July 14, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant