mercredi 22 mai 2019

How to fix poco Poco::Net::TCPServerParams() valgrind definite leak

I am using Poco and I am creating TCP server params as below: Poco::Net::TCPServerParams *pParams = new Poco::Net::TCPServerParams();

When I use Valgring, I get definite memory leak: 1271 ==00:00:01:37.131 48682== at 0x4C2903F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so )

at line: Poco::Net::TCPServerParams *pParams = new Poco::Net::TCPServerParams();

Poco version: dpkg -l | grep poco ii libpoco-dev 1.6.1-AVA3 amd64 C++ Portable Components (POCO) Development files ii libpoconet31 1.6.1-AVA3 amd64 C++ Portable Components (POCO) Network library

To fix it, I used delete on the pointer and but I get an error

delete pParams

'TCPServerParams.h:98:10: error: ‘virtual Poco::Net::TCPServerParams::~TCPServerParams()’ is protected'

Aucun commentaire:

Enregistrer un commentaire