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

Unified Diff: src/log.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: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index f3443faf053e731609dfbfb6779026d380565376..c4998c31fb321574f27058f4abef0690afd41e66 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -407,6 +407,7 @@ FILE* Logger::logfile_ = NULL;
Profiler* Logger::profiler_ = NULL;
Mutex* Logger::mutex_ = NULL;
VMState* Logger::current_state_ = NULL;
+VMState Logger::bottom_state_(OTHER);
SlidingStateWindow* Logger::sliding_state_window_ = NULL;
#endif // ENABLE_LOGGING_AND_PROFILING
@@ -1017,7 +1018,7 @@ bool Logger::Setup() {
mutex_ = OS::CreateMutex();
}
- current_state_ = new VMState(OTHER);
+ current_state_ = &bottom_state_;
// as log is initialized early with V8, we can assume that JS execution
// frames can never reach this point on stack
@@ -1052,8 +1053,6 @@ void Logger::TearDown() {
profiler_ = NULL;
}
- // Deleting the current_state_ has the side effect of assigning to it(!).
- while (current_state_) delete current_state_;
delete sliding_state_window_;
delete ticker_;

Powered by Google App Engine
This is Rietveld 408576698