Reviewers: Mads Ager, Rico,
Description:
Make StopProfiling resilient to calls in unusual moments.
Please review this at http://codereview.chromium.org/1658005/show
Affected files:
M src/cpu-profiler.cc
Index: src/cpu-profiler.cc
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc
index
b8bff262f4289ff6d698ae00dd91c22b96dbeed4..d1230340e694c374a78642a489bb0216769e4238
100644
--- a/src/cpu-profiler.cc
+++ b/src/cpu-profiler.cc
@@ -253,14 +253,12 @@ void CpuProfiler::StartProfiling(String* title) {
CpuProfile* CpuProfiler::StopProfiling(const char* title) {
- ASSERT(singleton_ != NULL);
- return singleton_->StopCollectingProfile(title);
+ return singleton_ != NULL ? singleton_->StopCollectingProfile(title) :
NULL;
}
CpuProfile* CpuProfiler::StopProfiling(String* title) {
- ASSERT(singleton_ != NULL);
- return singleton_->StopCollectingProfile(title);
+ return singleton_ != NULL ? singleton_->StopCollectingProfile(title) :
NULL;
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev