From dbce9878ab8830f194bc9e66a4e369082334bced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schnabel?= Date: Wed, 3 Jul 2024 10:35:11 +0200 Subject: [PATCH] Fix building stdthread.cpp for GCC 9. - TStdThread destructor doesn't need to be virtual as the class is not used polymorphically - Destructor of base class will be called automatically after derived one --- src/gdlib/gmsstrm.cpp | 2 +- src/rtl/stdthread.cpp | 1 - src/rtl/stdthread.h | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gdlib/gmsstrm.cpp b/src/gdlib/gmsstrm.cpp index bd63053e..01fa657c 100644 --- a/src/gdlib/gmsstrm.cpp +++ b/src/gdlib/gmsstrm.cpp @@ -117,7 +117,7 @@ void CompressTextFile( const std::string &fn, const std::string &fo, const std:: NrRead = Fin.Read( Buffer.data(), (int) Buffer.size() ); if( !NrRead ) break; Fout.Write( Buffer.data(), NrRead ); - } while( NrRead >= static_cast( Buffer.size() ) ); + } while( NrRead >= static_cast( Buffer.size() ) ); } void UnCompressTextFile( const std::string &fn, const std::string &fo, const std::string &PassWord, int &ErrNr, std::string &ErrMsg ) diff --git a/src/rtl/stdthread.cpp b/src/rtl/stdthread.cpp index ff4a5094..b2d99dac 100644 --- a/src/rtl/stdthread.cpp +++ b/src/rtl/stdthread.cpp @@ -118,7 +118,6 @@ TStdThread::~TStdThread() { if( joinable() ) detach(); - std::thread::~thread(); } catch( const std::exception & ) { diff --git a/src/rtl/stdthread.h b/src/rtl/stdthread.h index da794f27..439c56f9 100644 --- a/src/rtl/stdthread.h +++ b/src/rtl/stdthread.h @@ -56,7 +56,7 @@ class TStdThread : public std::thread { public: explicit TStdThread(const std::function &execute); - virtual ~TStdThread(); + ~TStdThread(); [[nodiscard]] uint64_t getThreadHash() const; };