Wednesday, April 20, 2011

Weird bug: Old New Friend

I just had a funny bug here that took me a while to catch. There was a container of pointers to objects. One of objects got deleted by someone else and didn't notify the container. Later, a new object was created at the same address and added to the container. The container was very happy to see an old friend :)

Conclusion: don't forget to assign zero to invalid pointers.

No comments:

Post a Comment