Hi all,
there is a code snippet like this
this -PClient = new IPCAMAClient (&tcpProfile, clientPriority) ;
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;
}
in the above case, whether the memory alloted by the new operator is
released perfectly or not?
since there is no delete operator in the else part,is this a memory
leak?
there is a code snippet like this
this -PClient = new IPCAMAClient (&tcpProfile, clientPriority) ;
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;
}
in the above case, whether the memory alloted by the new operator is
released perfectly or not?
since there is no delete operator in the else part,is this a memory
leak?
Comment