| @@ -269,6 +269,8 @@ namespace juce | |||||
| #include "text/juce_StringPool.h" | #include "text/juce_StringPool.h" | ||||
| #include "text/juce_Identifier.h" | #include "text/juce_Identifier.h" | ||||
| #include "text/juce_StringArray.h" | #include "text/juce_StringArray.h" | ||||
| #include "system/juce_SystemStats.h" | |||||
| #include "memory/juce_HeavyweightLeakedObjectDetector.h" | |||||
| #include "text/juce_StringPairArray.h" | #include "text/juce_StringPairArray.h" | ||||
| #include "text/juce_TextDiff.h" | #include "text/juce_TextDiff.h" | ||||
| #include "text/juce_LocalisedStrings.h" | #include "text/juce_LocalisedStrings.h" | ||||
| @@ -280,8 +282,6 @@ namespace juce | |||||
| #include "containers/juce_NamedValueSet.h" | #include "containers/juce_NamedValueSet.h" | ||||
| #include "containers/juce_DynamicObject.h" | #include "containers/juce_DynamicObject.h" | ||||
| #include "containers/juce_HashMap.h" | #include "containers/juce_HashMap.h" | ||||
| #include "system/juce_SystemStats.h" | |||||
| #include "memory/juce_HeavyweightLeakedObjectDetector.h" | |||||
| #include "time/juce_RelativeTime.h" | #include "time/juce_RelativeTime.h" | ||||
| #include "time/juce_Time.h" | #include "time/juce_Time.h" | ||||
| #include "streams/juce_InputStream.h" | #include "streams/juce_InputStream.h" | ||||
| @@ -44,14 +44,14 @@ class HeavyweightLeakedObjectDetector | |||||
| { | { | ||||
| public: | public: | ||||
| //============================================================================== | //============================================================================== | ||||
| HeavyweightLeakedObjectDetector() noexcept { getBacktraceMap().set (this, SystemStats::getStackBacktrace()); } | |||||
| HeavyweightLeakedObjectDetector (const HeavyweightLeakedObjectDetector&) noexcept { getBacktraceMap().set (this, SystemStats::getStackBacktrace()); } | |||||
| HeavyweightLeakedObjectDetector() noexcept { getBacktraceMap()[this] = SystemStats::getStackBacktrace(); } | |||||
| HeavyweightLeakedObjectDetector (const HeavyweightLeakedObjectDetector&) noexcept { getBacktraceMap()[this] = SystemStats::getStackBacktrace(); } | |||||
| ~HeavyweightLeakedObjectDetector() { getBacktraceMap().remove (this); } | |||||
| ~HeavyweightLeakedObjectDetector() { getBacktraceMap().erase (this); } | |||||
| private: | private: | ||||
| //============================================================================== | //============================================================================== | ||||
| typedef HashMap<HeavyweightLeakedObjectDetector<OwnerClass>*, String> BacktraceMap; | |||||
| typedef std::map<HeavyweightLeakedObjectDetector<OwnerClass>*, String> BacktraceMap; | |||||
| //============================================================================== | //============================================================================== | ||||
| struct BacktraceMapHolder | struct BacktraceMapHolder | ||||
| @@ -82,11 +82,11 @@ private: | |||||
| String str; | String str; | ||||
| int counter = 1; | int counter = 1; | ||||
| for (typename BacktraceMap::Iterator i (map); i.next();) | |||||
| for (auto& bt : map) | |||||
| { | { | ||||
| str << "\nBacktrace " << String (counter++) << "\n" | str << "\nBacktrace " << String (counter++) << "\n" | ||||
| << "-----------------------------------------------------------------" << "\n" | << "-----------------------------------------------------------------" << "\n" | ||||
| << i.getValue(); | |||||
| << bt.second; | |||||
| } | } | ||||
| return str; | return str; | ||||