• Advertisement

Archived

This topic is now archived and is closed to further replies.

delete operator

This topic is 5497 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im trying to release a pointer with sParticle *particle = new particle[10]; delete [] particle; My particle system works great with the pointers and all but the entire program bombs out whenever I try to free the dynamically allocated memory. Im also using the sParticle structure as a linked list...sParticle *child what if I accidently used the delete operator on a child that wasnt allocated..would it cause this? not to sure about all this..I just want it to work. thanks in advanced.

Share this post


Link to post
Share on other sites
Advertisement
I guess you''re running debug code, and the compiler will stick in a "heap memory check" when you release memory. So when you have damaged memory, you''re likely to find out when you release memory. The easiest way to be sure, is to remove code inbetween your newing and deleting. If it works then, your problem is inbetween.

More context and code would be helpful, and what the exact error reads.


Share this post


Link to post
Share on other sites

  • Advertisement