DescriptionFix Initialize & Dispose for external snapshot. Make sure v8::V8::(Initialize|Dispose) can be called in any order.
This is a follow-on to crrev.com/960883003, which fixed a memory leak in this code, but uncovered another, more subtle bug:
Previously, the code expected you would v8::V8::Initialize once, and v8::V8::Dispose once. The first bug was that in this case the holder_ variable would point to deallocated memory. The second bug was that once the snapshot was disposed, there was no way to get it back on a future Initialize. These are uncovered by the InitializeAndDisposeMultiple test case.
The fix is to keep memory to the raw snapshot and to then cleanly build & destroy the tables in Initialize & Dispose. Since sometimes setNativesBlob is called just after Initialize, that situation must be handled, too.
BUG=
Committed: https://crrev.com/2525e8f4026307cf7116e64bc0e9a1bb512cbfff
Cr-Commit-Position: refs/heads/master@{#26978}
Patch Set 1 #
Messages
Total messages: 7 (2 generated)
|