Skip to content

NFC: BridgeJS: Reduce retained object cleanup warning noise in BridgeJS glue#633

Open
krodak wants to merge 1 commit intoswiftwasm:mainfrom
PassiveLogic:kr/cleanup-warning-ownership-model
Open

NFC: BridgeJS: Reduce retained object cleanup warning noise in BridgeJS glue#633
krodak wants to merge 1 commit intoswiftwasm:mainfrom
PassiveLogic:kr/cleanup-warning-ownership-model

Conversation

@krodak
Copy link
Member

@krodak krodak commented Feb 13, 2026

Overview

BridgeJS-generated cleanup currently reads retained object IDs with swift.memory.getObject(id) before calling swift.memory.release(id). In cases where an ID is already invalid at cleanup time, that pre-read throws first and produces warning noise even though cleanup is already intended to be best-effort.

This change updates JSGlueGen to emit a shared retained-object cleanup helper that calls swift.memory.release(id) directly inside try/catch, and removes the getObject pre-check from generated cleanup blocks.

@krodak krodak self-assigned this Feb 13, 2026
Copy link
Member

@kateinoigakukun kateinoigakukun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we actually don't need the release because the ownership of the object id is taken by JSObject when popped

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.

2 participants