From: Dongsun Lee Date: Thu, 29 May 2025 02:30:37 +0000 (+0900) Subject: Fix covertiy issues for COPY_INSTEAD_OF_MOVE and GLOBAL_INIT_ORDER X-Git-Tag: accepted/tizen/unified/20250604.163022~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1e187e554caf3f15f88f992e1076869e056a56f;p=platform%2Fcore%2Fsecurity%2Fklay.git Fix covertiy issues for COPY_INSTEAD_OF_MOVE and GLOBAL_INIT_ORDER Change-Id: I2b581ccae0488203377bc2d4fc696bd6380b39bb --- diff --git a/include/klay/audit/logger.h b/include/klay/audit/logger.h index 4d75623..3333aef 100644 --- a/include/klay/audit/logger.h +++ b/include/klay/audit/logger.h @@ -67,7 +67,7 @@ do { \ audit::LogRecord record = { audit::LogLevel::level, \ __FILENAME__, __LINE__, __func__, \ FORMAT(message) }; \ - audit::Logger::log(logsink, record); \ + audit::Logger::log(logsink, std::move(record)); \ } while (0) #define ERROR2(logsink, message) LOG(logsink, message, Error) diff --git a/src/testbench/test-driver.cpp b/src/testbench/test-driver.cpp index 5b6628a..ab897db 100644 --- a/src/testbench/test-driver.cpp +++ b/src/testbench/test-driver.cpp @@ -19,16 +19,16 @@ namespace klay { namespace testbench { -std::unique_ptr TestDriver::instance = nullptr; std::once_flag TestDriver::flag; TestDriver& TestDriver::GetInstance() { + static std::unique_ptr instance = nullptr; std::call_once(TestDriver::flag, []() { - TestDriver::instance.reset(new TestDriver); + instance.reset(new TestDriver); }); - return *TestDriver::instance; + return *instance; } void TestDriver::addTestCase(TestCase* testCase) noexcept