Hi all,
I have a piece of code like this
constructor:
IPCClientDataTransfer::IPCClientDataTransfer (RWCString serviceName) :Valid(FALSE)
{
NSTcpProfile tcpProfile;
int clientPriority = 1;
tcpProfile.BlockingOnConnect = TRUE;
tcpProfile.Blocking = TRUE;
strcpy(tcpProfile.ServiceName, serviceName);
strcpy(tcpProfile.TcpHostName, "localhost");
this -> PClient = new IPCAMAClient (&tcpProfile, clientPriority);
// Check to see if the IPCAMAClient is a valid object
if (!this -> PClient -> isValid())
{
// The object is invalid, the connection was not established
delete this -> PClient;
this -> PClient = NULL;
}
else
{
// The Object is valid
this -> Valid = TRUE;
}
destructor:
IPCClientDataTransfer::~IPCClientDataTransfer ()
{
if (this -> PClient)
delete this -> PClient;
}
the destructor is not virtual.does this means that there will be memory leak?