From 9b8d1d4d65727d1074665e48f4033ee337367657 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Mon, 14 Dec 2020 20:33:36 +0100 Subject: [PATCH] Fixed a compile bug and added the address santiser --- CMakeLists.txt | 2 +- git-teaspeak | 2 +- server/src/DatabaseHelper.cpp | 6 +++--- server/src/terminal/PipedTerminal.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16c8909..ef13fbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ set(TEASPEAK_SERVER ON) #end now #set(MEMORY_DEBUG_FLAGS " -fsanitize=leak -fsanitize=address -fstack-protector-all ") -#set(MEMORY_DEBUG_FLAGS "-fsanitize=address") +set(MEMORY_DEBUG_FLAGS "-fsanitize=address -fstack-protector-all") if (NOT BUILD_OS_ARCH) set(BUILD_OS_ARCH $ENV{build_os_arch}) diff --git a/git-teaspeak b/git-teaspeak index 9cd6648..3a9c535 160000 --- a/git-teaspeak +++ b/git-teaspeak @@ -1 +1 @@ -Subproject commit 9cd6648d5f7fb9911c59f03464f8f724df535816 +Subproject commit 3a9c5359719d893a35646191389c17338460535a diff --git a/server/src/DatabaseHelper.cpp b/server/src/DatabaseHelper.cpp index fc43b2e..347b912 100644 --- a/server/src/DatabaseHelper.cpp +++ b/server/src/DatabaseHelper.cpp @@ -232,9 +232,9 @@ inline sql::result load_permissions_v2( return 0; }); - auto end = system_clock::now(); - auto time = end - start; - logTrace(server_id, "[SQL] load_permissions(\"{}\") took {}ms", command.sqlCommand(), duration_cast(time).count()); + //auto end = system_clock::now(); + //auto time = end - start; + //logTrace(server_id, "[SQL] load_permissions(\"{}\") took {}ms", command.sqlCommand(), duration_cast(time).count()); } constexpr static std::string_view kPermissionUpdateCommand{"UPDATE `permissions` SET `value` = :value, `grant` = :grant, `flag_skip` = :flag_skip, `flag_negate` = :flag_negate WHERE `serverId` = :serverId AND `type` = :type AND `id` = :id AND `permId` = :permId AND `channelId` = :chId"}; diff --git a/server/src/terminal/PipedTerminal.cpp b/server/src/terminal/PipedTerminal.cpp index 7fbafe1..b2c6384 100644 --- a/server/src/terminal/PipedTerminal.cpp +++ b/server/src/terminal/PipedTerminal.cpp @@ -82,8 +82,8 @@ void terminal::initialize_pipe(const std::string& pipe_path) { } void terminal::finalize_pipe() { - if(event_base) { - event_base_loopexit(event_base, nullptr); + if(auto ev_base{std::exchange(event_base, nullptr)}; ev_base) { + event_base_loopexit(ev_base, nullptr); if(event_loop_dispatcher.joinable() && std::this_thread::get_id() != event_loop_dispatcher.get_id()) event_loop_dispatcher.join();