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

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

Issue 53089: Fixed test memory leaks (Closed)
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
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index c9f1f4286686f4f11acb8c7618f8cb29e8a55b07..87cc98ce5a44f870c0f58eced68b6326731d22ca 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -154,7 +154,7 @@ class ApiTestFuzzer: public v8::internal::Thread {
class RegisterThreadedTest {
public:
explicit RegisterThreadedTest(CcTest::TestFunction* callback)
- : callback_(callback) {
+ : fuzzer_(NULL), callback_(callback) {
prev_ = first_;
first_ = this;
count_++;
@@ -5098,6 +5098,10 @@ void ApiTestFuzzer::ContextSwitch() {
void ApiTestFuzzer::TearDown() {
fuzzing_ = false;
+ for (int i = 0; i < RegisterThreadedTest::count(); i++) {
+ ApiTestFuzzer *fuzzer = RegisterThreadedTest::nth(i)->fuzzer_;
+ if (fuzzer != NULL) fuzzer->Join();
+ }
}

Powered by Google App Engine
This is Rietveld 408576698