From 75359bc9c2bd9f593c59fb156186b3491d0b7c47 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Fri, 14 Feb 2020 03:30:23 -0500 Subject: fixed crash when disabling mod --- src/shared/directoryentry.cpp | 8 +++++--- src/shared/directoryentry.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/shared') diff --git a/src/shared/directoryentry.cpp b/src/shared/directoryentry.cpp index 0be5e870..2605d083 100644 --- a/src/shared/directoryentry.cpp +++ b/src/shared/directoryentry.cpp @@ -55,8 +55,8 @@ void elapsedImpl(std::chrono::nanoseconds& out, F&& f) // elapsed() is not optimized out when EnableInstrumentation is false even // though it's equivalent that this macro -//#define elapsed(OUT, F) (F)(); -#define elapsed(OUT, F) elapsedImpl(OUT, F); +#define elapsed(OUT, F) (F)(); +//#define elapsed(OUT, F) elapsedImpl(OUT, F); static std::wstring tail(const std::wstring &source, const size_t count) @@ -843,7 +843,9 @@ void FileRegister::sortOrigins() std::scoped_lock lock(m_Mutex); for (auto&& p : m_Files) { - p->sortOrigins(); + if (p) { + p->sortOrigins(); + } } } diff --git a/src/shared/directoryentry.h b/src/shared/directoryentry.h index 74d50625..f406ced6 100644 --- a/src/shared/directoryentry.h +++ b/src/shared/directoryentry.h @@ -64,7 +64,7 @@ class FileRegister; struct DirectoryStats { - static constexpr bool EnableInstrumentation = true; + static constexpr bool EnableInstrumentation = false; std::string mod; -- cgit v1.3.1