From 7bc0838c1ee6c5e3ef83bd9ca3ba56a33d622562 Mon Sep 17 00:00:00 2001 From: chaoqin-li1123 Date: Thu, 7 Jan 2021 11:57:45 -0600 Subject: [PATCH] fix new/free mismatch in Mainthread utility Signed-off-by: chaoqin-li1123 --- source/common/common/thread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/common/thread.h b/source/common/common/thread.h index 8c9d991268aa0..bb86e0de33775 100644 --- a/source/common/common/thread.h +++ b/source/common/common/thread.h @@ -174,7 +174,7 @@ struct MainThread { bool inMainThread() const { return main_thread_id_ == std::this_thread::get_id(); } static void init() { MainThreadSingleton::initialize(new MainThread()); } static void clear() { - free(MainThreadSingleton::getExisting()); + delete MainThreadSingleton::getExisting(); MainThreadSingleton::clear(); } static bool isMainThread() { return MainThreadSingleton::get().inMainThread(); }