Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Jan 15, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

…nder (#42153)

# Why

When `useReleaseSharedObject` creates a new object in its `useMemo`
hook, it calls release on the old one immediately.

This can cause a callsite to try to use the object (after the hook
released the old object, but before the render function has finished)

This is visible in `expo-audio` where the audio recorder is released and
then used, causing an exception to be thrown on both iOS and Android
complaining about a released object being accessed.

# How

This fixes the above problem by deferring releasing the object until
after render is done.

# Test Plan

- Run BareExpo
- Open `API` / `Audio`
- Open Audio recorder screen
- Toggle high/low quality

Observe: The app crashes
Expected: App should not crash

✅ Bare Expo iOS
✅ Bare Expo Android 

# Checklist

- [x] I added a `changelog.md` entry and rebuilt the package sources
according to [this short
guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting)
- [x] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

Co-authored-by: Tomasz Sapeta <[email protected]>
@pull pull bot locked and limited conversation to collaborators Jan 15, 2026
@pull pull bot added the ⤵️ pull label Jan 15, 2026
@pull pull bot merged commit eaa6b9f into code:main Jan 15, 2026
13 of 14 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant