diff --git a/bin/dsn.cmake b/bin/dsn.cmake index 7f4f908989..272bc4cb4e 100644 --- a/bin/dsn.cmake +++ b/bin/dsn.cmake @@ -199,6 +199,8 @@ function(dsn_setup_compiler_flags) add_compile_options(-Wno-deprecated-declarations) add_compile_options(-Wno-inconsistent-missing-override) add_compile_options(-Wno-attributes) + # Must add virtual on all base destructors. + add_compile_options(-Wnon-virtual-dtor) # -fno-omit-frame-pointer # use frame pointers to allow simple stack frame walking for backtraces. # This has a small perf hit but worth it for the ability to profile in production diff --git a/include/dsn/utility/priority_queue.h b/include/dsn/utility/priority_queue.h index 17d1125987..fae557439d 100644 --- a/include/dsn/utility/priority_queue.h +++ b/include/dsn/utility/priority_queue.h @@ -24,15 +24,6 @@ * THE SOFTWARE. */ -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #pragma once #include @@ -52,6 +43,8 @@ class priority_queue _count = 0; } + virtual ~priority_queue() = default; + virtual long enqueue(T obj, uint32_t priority) { assert(priority >= 0 && priority < priority_count); // "wrong priority"); diff --git a/include/dsn/utility/work_queue.h b/include/dsn/utility/work_queue.h index 0b3fb7e0cf..7386b04d96 100644 --- a/include/dsn/utility/work_queue.h +++ b/include/dsn/utility/work_queue.h @@ -50,7 +50,7 @@ class work_queue _current_op_count = 0; } - ~work_queue() + virtual ~work_queue() { scope_lk l(_lock); assert(_hdr.is_empty()); @@ -106,4 +106,4 @@ class work_queue protected: slist _hdr; }; -} \ No newline at end of file +} diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 512d99a35c..b80cbf2845 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -47,9 +47,9 @@ set(OSS_URL_PREFIX "http://pegasus-thirdparties.oss-cn-beijing.aliyuncs.com") message(STATUS "Setting up third-parties...") ExternalProject_Add(boost - URL ${OSS_URL_PREFIX}/boost_1_69_0.tar.bz2 - https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.bz2 - URL_MD5 a1332494397bf48332cb152abfefcec2 + URL ${OSS_URL_PREFIX}/boost_1_76_0.tar.bz2 + https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2 + URL_MD5 33334dd7f862e8ac9fe1cc7c6584fb6d CONFIGURE_COMMAND ./bootstrap.sh --prefix=. --with-libraries=system,filesystem,regex --with-toolset=gcc BUILD_COMMAND ./b2 toolset=gcc cxxflags=-fPIC cxxstd=11 install INSTALL_COMMAND cp -R include/boost ${TP_OUTPUT}/include && cp -R lib ${TP_OUTPUT}/