From fcfe73d8f1ff5ca5b3e6bcb7382c1593400c3b11 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 12 Sep 2023 16:19:20 +0200 Subject: [PATCH] Nanotrace: Shutdown should do nothing if not initialized Change-Id: I717296da4c9aea1e9dd28db3421a927f6bb8d332 Reviewed-by: Knud Dollereder --- src/libs/nanotrace/nanotrace.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/nanotrace/nanotrace.cpp b/src/libs/nanotrace/nanotrace.cpp index 658d84a43f1..c5adeb4d724 100644 --- a/src/libs/nanotrace/nanotrace.cpp +++ b/src/libs/nanotrace/nanotrace.cpp @@ -168,6 +168,9 @@ void init(const std::string &process, const std::string &thread, const std::stri void shutdown() { + if (!initEvent.initialized) + return; + flush(); if (std::ofstream stream(initEvent.filePath, std::ios::app); stream.good())