-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(bridge): Synchronize access to Strong handles in collection adapters
`TNSArrayAdapter`, `TNSDataAdapter` and `TNSDictionaryAdapter` hold `Strong` references to their underlying JS objects. When the Objective-C instances of these classes were `dealloc`-ed, these references' destructors were being called outside of the JSC VM's lock which lead to nasty and rarely occurring crashes when such adapters are being used in threads different than the main thread of the JSC engine. * Do not store `ExecState`s as calls to an adapter can be made long after the JS state has changed. Use global object's `globalExec` instead. * Reset `Strong` handles inside the locked section. This way the C++ destructor of a nullptr handle will not have to modify anything in the VM's heap.
- Loading branch information
1 parent
11304ed
commit b1cfb82
Showing
3 changed files
with
93 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters