Skip to main content
gamedev.net
🔒 Locked

Error - HELP! Anyone know...

Started by ATronic 1 reply 350+ views
Original Post
ATronic
ATronic
Hi, I am using a test implementation of my game engine. Everything was working fine until I added a test of my particle system. It uses dynamic memory allocation. eg: type *var; var = new type; delete[] type; When the program starts, I allocate the memory, when it ends, I de-allocate it. When the program ends, I get an unhandled exeption error. Anyone have an idea why? I think it has to do with releasing the memory, but I can''t seem to resolve it. Thank you to all who reply. Alex Broadwin A-Tronic Software & Design ----- "if you fail in life, you were destined to fail. If you suceed in life, call me." "The answer is out there." "Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
Fruny
Fruny
  
// Use either


var = new X;
delete var;

// OR


var = new X[10];
delete[] var;

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
ATronic
ATronic
Aha, thnx. I did know that, but missed one burried deconstructer with the wrong one. Thanks a ton!

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.