-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Fix top-level v8::Locker #3038
Comments
Hey, so this had nothing to do with Locker. Locker makes v8 a little louder about errors while in debug mode, but by deleting the Locker all you're doing is hiding issues that exist already. In the vm module there exists many cases where you enter a context but don't exit it. I submitted a pull request that adds the Locker back yet again, and fixes the particular issue you mentioned. But really you should avoid reverting this in the future. My first commit adding Locker did have an issue, but I'm confident that the implementation is now robust. It will make certain errors louder, but those errors would have led to more quiet memory leaks without the extra error checking. My pull request adds a small wrapper class for locally-scoped persistent handles. You could use a similar pattern to simplify complicated Dispose() logic throughout node. |
Also the included PersistentScope class could be a little bit cleaner, replacing v8::Persistent entirely in cases where it makes sense. I'd be interested in working on cleaning up patterns like this throughout node if there's mutual interest amongst Joyent. |
/cc @bnoordhuis ;) |
After a bit of back and forth this seems to be closed. @laverdet Can you please comment if there's still anything to do here, and I'll reopen in that case? Thanks. |
@laverdet
We reverted your commit in 4071815 because it made some repl tests crash in debug mode.
The text was updated successfully, but these errors were encountered: