Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Unified Diff: src/global-handles.cc

Issue 173060: Do not allow GlobalHandles::Create to reuse destoryed nodes (ones from free l... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/global-handles.cc
===================================================================
--- src/global-handles.cc (revision 2717)
+++ src/global-handles.cc (working copy)
@@ -156,6 +156,10 @@
if (func != NULL) {
v8::Persistent<v8::Object> object = ToApi<v8::Object>(handle());
{
+ // Forbid reuse of destroyed nodes as they might be already deallocated.
+ // It's fine though to reuse nodes that were destroyed in weak callback
+ // as those cannot be deallocated until we are back from the callback.
+ set_first_free(NULL);
Mads Ager (chromium) 2009/08/19 17:32:07 Doesn't this leak the nodes on the free list? Sho
antonm 2009/08/19 17:39:32 I don't think so. To the best of my knowledge we
// Leaving V8.
VMState state(EXTERNAL);
func(object, par);
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698