pocoproject / poco

The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.
https://pocoproject.org
Other
8.07k stars 2.11k forks source link

Thread destructor #4473

Closed micheleselea closed 4 months ago

micheleselea commented 4 months ago

In thread destructor we have

Thread::~Thread()
{
    delete _pTLS;
}

I think we can use clearTLS() because it checks if _pTLS is not null I think sometimes delete _pTLS; with _pTLS==0 gives me error, at least in debug environment, I don't know if it affects even release environment, it seems related to Thread that handle the TCPServer

micheleselea commented 4 months ago

mmm I don't think the reason is the delete _pTLS; it's something in thread destructor but not that, even if it's not nice to do delete null. I'll keep checking