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

Unified Diff: test/cctest/test-api.cc

Issue 46103: Fixed some memory leaks in unit tests. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 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-ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
===================================================================
--- test/cctest/test-api.cc (revision 1514)
+++ test/cctest/test-api.cc (working copy)
@@ -117,6 +117,7 @@
gate_(v8::internal::OS::CreateSemaphore(0)),
active_(true) {
}
+ ~ApiTestFuzzer() { delete gate_; }
// The ApiTestFuzzer is also a Thread, so it has a Run method.
virtual void Run();
@@ -5566,14 +5567,14 @@
// Add more than 8 (see kMaxFastProperties) properties
// so that the constructor will force copying map.
// Cannot sprintf, gcc complains unsafety.
- char buf[5];
+ char buf[4];
for (char i = '0'; i <= '9' ; i++) {
- buf[1] = i;
+ buf[0] = i;
for (char j = '0'; j <= '9'; j++) {
- buf[2] = j;
+ buf[1] = j;
for (char k = '0'; k <= '9'; k++) {
- buf[3] = k;
- buf[4] = 0;
+ buf[2] = k;
+ buf[3] = 0;
templ->Set(v8_str(buf), v8::Number::New(k));
}
}
@@ -5621,6 +5622,7 @@
v8::ScriptData *sd = v8::ScriptData::PreCompile(script, strlen(script));
CHECK_NE(sd->Length(), 0);
CHECK_NE(sd->Data(), NULL);
+ delete sd;
}
@@ -5702,6 +5704,8 @@
CHECK(regexp_success_);
CHECK(gc_success_);
}
+ RegExpInterruptTest() : block_(NULL) {}
+ ~RegExpInterruptTest() { delete block_; }
private:
// Number of garbage collections required.
static const int kRequiredGCs = 5;
« no previous file with comments | « no previous file | test/cctest/test-ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698