stilldesign / PhysX.Net

A .NET wrapper for NVIDIA PhysX 4.1.2 written using C++/CLI.
MIT License
206 stars 55 forks source link

fix SimulationCallback.OnContact crash (caused by a double free) #9

Closed gepa21 closed 10 years ago

gepa21 commented 10 years ago

I believe there is a double free here that causes a crash.

The delete in ContactPair destructor causes a crash. (i believe the SDK will also try to free it after finish calling OnContact callback?)

stilldesign commented 10 years ago

Yeah sounds about right, especially seeing as the PxContactPair variable is passed in to the constructor as opposed to being created in it