diff --git a/CMakeLists.txt b/CMakeLists.txt index 4daa5b6..bd8ff3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20) include(cmake/color.cmake) -set(BLT_VERSION 0.18.20) +set(BLT_VERSION 0.18.21) set(BLT_TEST_VERSION 0.0.1) set(BLT_TARGET BLT) diff --git a/src/blt/profiling/profiler_v2.cpp b/src/blt/profiling/profiler_v2.cpp index 1c8c2b1..ff5e55d 100644 --- a/src/blt/profiling/profiler_v2.cpp +++ b/src/blt/profiling/profiler_v2.cpp @@ -227,11 +227,15 @@ namespace blt void _internal::endInterval(const std::string& profile_name, const std::string& interval_name) { + if (profiles[profile_name].empty() || profiles[profile_name].find(interval_name) == profiles[profile_name].end()) + return; blt::endInterval(profiles[profile_name].at(interval_name)); } void _internal::writeProfile(std::ifstream& stream, const std::string& profile_name) { + if (profiles.find(profile_name) == profiles.end()) + return; auto& pref = profiles[profile_name]; profile_t profile{profile_name}; for (const auto& i : pref) @@ -242,6 +246,8 @@ namespace blt void _internal::printProfile(const std::string& profile_name, std::uint32_t flags, sort_by sort, blt::logging::log_level log_level) { + if (profiles.find(profile_name) == profiles.end()) + return; auto& pref = profiles[profile_name]; profile_t profile{profile_name}; for (const auto& i : pref)