From: Chuck B. <cb...@vi...> - 2001-07-15 00:05:16
|
On Saturday 14 July 2001 16:49, Dale Heatherington wrote: :: Greetings. :: I have just been granted access to the sourceforge aprsd project. :: :: While working on the html status page generation code to fixup the :: truncation problem I learned that the delete operator needs a "[]" :: after it to work on arrays. My documentaton says results are :: unpredictable if just delete alone is used. So instead of "delete cp" :: it should be "delete [] cp". As you would expect, aprsd is full of cases :: where "delete" is used to free character arrays. Is this a real :: problem? Could this be the cause of come of the stability problems? I've been changing these as I've come across them. delete[] is technically only required when deleting a pointer to a char array as delete has no way of knowing what [class] cp is pointing to and some classes require specially handling. However, using the '[]' syntax is generally a good practice as well as setting the pointer to NULL. Chuck |