"Prakash K. Cheemplavam" wrote:
Klaus Schmidinger wrote:
Philip Lawatsch wrote:
Should probably be
if (ExtendedEventDescriptors)
delete ExtendedEventDescriptors;
if (ShortEventDescriptor)
delete ShortEventDescriptor;
'delete' is guaranteed to be "NULL-proof", so there's no need to check the
pointer first.
(While not having looked into the source) are both variables explicitly
NULLed if not initialised? It is a common mistake to not do it, then the
var holds a random value!=NULL and delete will go boom...
Prakash
SI::ExtendedEventDescriptors *ExtendedEventDescriptors = NULL;
SI::ShortEventDescriptor *ShortEventDescriptor = NULL;
...
delete ExtendedEventDescriptors;
delete ShortEventDescriptor;
Klaus