Skip to content

Commit

Permalink
Fix building stdthread.cpp for GCC 9.
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
0x17 committed Jul 3, 2024
1 parent 7439360 commit dbce987
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gdlib/gmsstrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>( Buffer.size() ) );
} while( NrRead >= static_cast<decltype(NrRead)>( Buffer.size() ) );
}

void UnCompressTextFile( const std::string &fn, const std::string &fo, const std::string &PassWord, int &ErrNr, std::string &ErrMsg )
Expand Down
1 change: 0 additions & 1 deletion src/rtl/stdthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ TStdThread::~TStdThread()
{
if( joinable() )
detach();
std::thread::~thread();
}
catch( const std::exception & )
{
Expand Down
2 changes: 1 addition & 1 deletion src/rtl/stdthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class TStdThread : public std::thread
{
public:
explicit TStdThread(const std::function<void()> &execute);
virtual ~TStdThread();
~TStdThread();
[[nodiscard]] uint64_t getThreadHash() const;
};

Expand Down

0 comments on commit dbce987

Please sign in to comment.