From bad0881df568db3250b584a43f99fa3eda98639b Mon Sep 17 00:00:00 2001 From: Grischa Hauser Date: Fri, 2 May 2025 16:24:54 +0200 Subject: [PATCH] Fix EventHandler constructor to initialize start_time after other member variables --- include/ctrack.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/ctrack.hpp b/include/ctrack.hpp index 4641378..9b57dcd 100644 --- a/include/ctrack.hpp +++ b/include/ctrack.hpp @@ -819,13 +819,14 @@ namespace ctrack { EventHandler(int line = __builtin_LINE(), const char* filename = __builtin_FILE(), const char* function = __builtin_FUNCTION(), std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now()) : line(line) { - this->start_time = start_time; + previous_store_clear_cnt = store::store_clear_cnt; this->filename = filename; this->function = function; while (store::write_events_locked) {} register_event(); + this->start_time = start_time; } ~EventHandler() { auto end_time = std::chrono::high_resolution_clock::now();