From 657213f13d49f0d2caaa8b64c1245ec8c75fc4d7 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 24 Jul 2024 11:44:13 -0700 Subject: Cleanup global memory allocations on shutdown. (#4731) Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> --- source/core/slang-performance-profiler.cpp | 4 ++++ source/core/slang-performance-profiler.h | 1 + 2 files changed, 5 insertions(+) (limited to 'source/core') diff --git a/source/core/slang-performance-profiler.cpp b/source/core/slang-performance-profiler.cpp index faf06bb92..b480e1c8e 100644 --- a/source/core/slang-performance-profiler.cpp +++ b/source/core/slang-performance-profiler.cpp @@ -42,6 +42,10 @@ namespace Slang { data.clear(); } + virtual void dispose() override + { + data = decltype(data)(); + } }; PerformanceProfiler* Slang::PerformanceProfiler::getProfiler() diff --git a/source/core/slang-performance-profiler.h b/source/core/slang-performance-profiler.h index 372a7b273..71b34d262 100644 --- a/source/core/slang-performance-profiler.h +++ b/source/core/slang-performance-profiler.h @@ -29,6 +29,7 @@ public: virtual void exitFunction(FuncProfileContext context) = 0; virtual void getResult(StringBuilder& out) = 0; virtual void clear() = 0; + virtual void dispose() = 0; public: static PerformanceProfiler* getProfiler(); }; -- cgit v1.2.3