From c3dc1175902091cf9e44202db014267807d4eb43 Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Thu, 5 Mar 2015 16:23:17 -0800 Subject: [PATCH] Bug 1136834 - Stop leaking markers in ProfileBuffer. (r=mstange) --- tools/profiler/ProfileEntry.cpp | 6 ++++++ tools/profiler/ProfileEntry.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/profiler/ProfileEntry.cpp b/tools/profiler/ProfileEntry.cpp index 4ec25b9880a..b2b02b0357c 100644 --- a/tools/profiler/ProfileEntry.cpp +++ b/tools/profiler/ProfileEntry.cpp @@ -105,6 +105,12 @@ ProfileBuffer::ProfileBuffer(int aEntrySize) { } +ProfileBuffer::~ProfileBuffer() +{ + mGeneration = INT_MAX; + deleteExpiredStoredMarkers(); +} + // Called from signal, call only reentrant functions void ProfileBuffer::addTag(const ProfileEntry& aTag) { diff --git a/tools/profiler/ProfileEntry.h b/tools/profiler/ProfileEntry.h index 3009b74535a..c57799ae5c8 100644 --- a/tools/profiler/ProfileEntry.h +++ b/tools/profiler/ProfileEntry.h @@ -90,7 +90,7 @@ protected: char* processDynamicTag(int readPos, int* tagsConsumed, char* tagBuff); int FindLastSampleOfThread(int aThreadId); - ~ProfileBuffer() {} + ~ProfileBuffer(); public: // Circular buffer 'Keep One Slot Open' implementation for simplicity