| Index: src/cpu-profiler.cc
|
| diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc
|
| index b1af621cccc1a3425e87534faafa8b14cea77c7f..c36850c1e0c436783dd5dfb5058673a59e4a7d99 100644
|
| --- a/src/cpu-profiler.cc
|
| +++ b/src/cpu-profiler.cc
|
| @@ -176,6 +176,10 @@ void CpuProfiler::DeleteAllProfiles() {
|
| void CpuProfiler::DeleteProfile(CpuProfile* profile) {
|
| profiles_->RemoveProfile(profile);
|
| delete profile;
|
| + if (profiles_->profiles()->is_empty() && !is_profiling_) {
|
| + // If this was the last profile, clean up all accessory data as well.
|
| + ResetProfiles();
|
| + }
|
| }
|
|
|
|
|
| @@ -376,7 +380,6 @@ CpuProfiler::CpuProfiler(Isolate* isolate)
|
| sampling_interval_(TimeDelta::FromMicroseconds(
|
| FLAG_cpu_profiler_sampling_interval)),
|
| profiles_(new CpuProfilesCollection(isolate->heap())),
|
| - next_profile_uid_(1),
|
| generator_(NULL),
|
| processor_(NULL),
|
| is_profiling_(false) {
|
| @@ -391,7 +394,6 @@ CpuProfiler::CpuProfiler(Isolate* isolate,
|
| sampling_interval_(TimeDelta::FromMicroseconds(
|
| FLAG_cpu_profiler_sampling_interval)),
|
| profiles_(test_profiles),
|
| - next_profile_uid_(1),
|
| generator_(test_generator),
|
| processor_(test_processor),
|
| is_profiling_(false) {
|
| @@ -417,7 +419,7 @@ void CpuProfiler::ResetProfiles() {
|
|
|
|
|
| void CpuProfiler::StartProfiling(const char* title, bool record_samples) {
|
| - if (profiles_->StartProfiling(title, next_profile_uid_++, record_samples)) {
|
| + if (profiles_->StartProfiling(title, record_samples)) {
|
| StartProcessorIfNotStarted();
|
| }
|
| processor_->AddCurrentStack(isolate_);
|
|
|