A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by pHySiQuE » Wed Jan 23, 2013 12:25 am
If I call NewtonDestroy(NewtonCreate()); in a loop, the program crashes after a few seconds. It looks like some kind of thread issue. See attached image:

- Image2.jpg (254.96 KiB) Viewed 1863 times
The callstack looks like this:

- Image4.jpg (41.53 KiB) Viewed 1862 times
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by Julio Jerez » Wed Jan 23, 2013 8:27 am
I know it should not crash, but how are you using something NewtonDestroy(NewtonCreate());
what porpose does that serve other that fragment memory a lot?
I will set a small test to do just that and see if I find the crash
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by pHySiQuE » Wed Jan 23, 2013 11:25 am
I was just testing for memory leaks in a loop. I know it's not realistic usage, but it still shouldn't crash.
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by Julio Jerez » Wed Jan 23, 2013 11:40 am
should something like this
- Code: Select all
int main(int argc, char ** argv)
{
for (int = 0; i < 100; i ++)
NewtonDestroy(NewtonCreate());
}
reproduce that error?
I pasted this in the main funtion
- Code: Select all
// start the real time loop, by sending a message that send himself again
application.addChore(mainWindow, NewtonDemos::ID_CHORE);
for (int i = 0; i < 100; i ++)
NewtonDestroy(NewtonCreate());
// Run the application
return application.run();
and it does not chrashes, should I run it form more iterations?
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by pHySiQuE » Wed Jan 23, 2013 12:05 pm
I should make a VS project to explore this further. I am able to crash it with less than 100 iterations.
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by Julio Jerez » Wed Jan 23, 2013 12:33 pm
I do not know I increase the iterations to 1000, and I still do not get to crash
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 0 guests