You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 12ff142
Browse filesBrowse the repository at this point in the historyBrowse files
feat(runtime): wrapper lifetime diagnostics and released-object arguments
A JS object whose ObjC wrapper was released (a resurrected holder's graph
can keep it reachable) used to reach native code as a DictionaryAdapter
standing in for the object, so UIKit received a dictionary where it
expected, for example, a UIColor. A method call on it asserted in Release.
Released ObjC wrappers now carry a ReleasedReason in internal field 0
(collected, released through __releaseNativeCounterpart, or teardown).
GetValue only reads Externals, so existing callers are unaffected. Where
an object is expected, the marker routes the value through
releasedObjectPolicy: an argument becomes nil (report) or throws a
ReferenceError (throw), a collection element becomes NSNull, a
JS-implemented method's return value becomes nil, and a method or
property call on it always throws a ReferenceError, also through a Proxy.
ns:runtime gains getWrapperLifetimeStats() (resurrections, collections,
explicit releases, released-object accesses, state-lost candidates and
confirmations, counted on cold paths in every build) and the
wrapperLifetimeWarnings key. With warnings on (default in debug builds,
or "wrapperLifetime": { "warnings": bool } in the app config), a
collected wrapper that carried JS properties while its object was still
retained elsewhere is checked again a runloop turn later through a weak
reference, and a still-alive object is reported once per class.
0 commit comments