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

Unified Diff: src/api.cc

Issue 302603002: Fix mem leaks in tests. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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/api.cc
diff --git a/src/api.cc b/src/api.cc
index c33365b931fab61d8513b050df60321fac395877..a8ab53723b7a58ef5d9e3b243a4d5dfa5a4a8545 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1728,6 +1728,13 @@ Local<UnboundScript> ScriptCompiler::CompileUnbound(
cached_data_mode,
i::NOT_NATIVES_CODE);
has_pending_exception = result.is_null();
+ if (has_pending_exception && cached_data_mode == i::CONSUME_CACHED_DATA) {
+ // This case won't happen during normal operation; we have compiled
+ // successfully and produced cached data, and but the second compilation
+ // of the same source code fails.
+ delete script_data_impl;
+ script_data_impl = NULL;
+ }
EXCEPTION_BAILOUT_CHECK(isolate, Local<UnboundScript>());
raw_result = *result;
if ((options & kProduceDataToCache) && script_data_impl != NULL) {
« 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