diff options
Diffstat (limited to 'source/core/StarLogging.cpp')
-rw-r--r-- | source/core/StarLogging.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/core/StarLogging.cpp b/source/core/StarLogging.cpp index 55cd27d..b80ae6a 100644 --- a/source/core/StarLogging.cpp +++ b/source/core/StarLogging.cpp @@ -179,10 +179,15 @@ Deque<SpatialLogger::LogText> SpatialLogger::getText(char const* space, bool and } void SpatialLogger::clear() { - MutexLocker locker(s_mutex); - s_lines.clear(); - s_points.clear(); - s_logText.clear(); + decltype(s_lines) lines; + decltype(s_points) points; + decltype(s_logText) logText; + { + MutexLocker locker(s_mutex); + lines = move(s_lines); + points = move(s_points); + logText = move(s_logText); + } // Move while locked to deallocate contents while unlocked. } Mutex SpatialLogger::s_mutex; |