Answer to Question #3363 in Action Script | Flash | Flex | ColdFusion for suman majumder
Dangling pointers arise when an object is deleted or deallocated, without modifying
the value of the pointer, so that the pointer still points to the memory location of
the deallocated memory. As the system may reallocate the previously freed memory to
another process, if the original program then dereferences the dangling pointer,
unpredictable behavior may result, as the memory may now contain completely
A straightforward example is shown below:
char *dp = NULL;
/* ... */
dp = &c;
/* c falls out of scope */
/* dp is now a dangling pointer */
A solution to the above is to assign NULL to cp immediately before the inner block
is exited. Another solution would be to somehow guarantee cp is not used again
without further initialisation.
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
You are welcome!
Thank you very very much sir!!!