diff --git a/src/profile_manager.cpp b/src/profile_manager.cpp index 488ee38..7df46b2 100644 --- a/src/profile_manager.cpp +++ b/src/profile_manager.cpp @@ -2,6 +2,8 @@ #include #include +#include + using namespace profiler; extern "C"{ @@ -80,10 +82,11 @@ void ProfileManager::beginBlock(Block* _block) void ProfileManager::endBlock() { + if (!m_isEnabled) return; - size_t threadId = std::hash()(std::this_thread::get_id()); + uint32_t threadId = std::hash()(std::this_thread::get_id()); guard_lock_t lock(m_spin); auto& stackOfOpenedBlocks = m_openedBracketsMap[threadId];