Closed GoogleCodeExporter closed 9 years ago
Okay, so I managed to get VS to trigger a AccessViolationException exception by
compiling bullet and libbulletc in debug configuration and found out the crash
is caused by the Dispose method of RotationalLimitMotor in
Generic6DofConstraint.cs on line btRotationalLimitMotor_delete(_native);.
It would seem like the garbage collector in .NET2.0/3.5 tries to dispose the
rotational limit motor around a second after running the program, which causes
a crash for some reason. The crash can be postponed by explicitly saving a
reference to the RotationalLimitMotor object, but in this case the crash
happens when quitting the program.
For now I just commented out the dispose methods of RotationalLimitMotor to
suppress the crashes, which will cause memory leak on the long run if I'm not
completely mistaken. I wonder if there's a better solution?
Original comment by TheZ...@gmail.com
on 24 Jun 2014 at 10:59
btGeneric6DofConstraint allocates memory for the btRotationalLimitMotors by
itself, but the wrapper class RotationalLimitMotor thinks that it is
responsible for freeing that memory.
The solution is to add a preventDelete flag to RotationalLimitMotor so that it
woouldn't delete the object that really belongs to btGeneric6DofConstraint.
I'll fix it today.
Don't worry about the wall of text. I like detailed bug reports very much. :)
Original comment by andres.traks
on 24 Jun 2014 at 3:00
Fixed in r644.
Original comment by andres.traks
on 24 Jun 2014 at 10:50
Original issue reported on code.google.com by
TheZ...@gmail.com
on 23 Jun 2014 at 3:31Attachments: