Ok I played this again and I can not reproduce the error.
But anyway if you are having a crash because a piece of memory allocated in the address space of one DLL in deleted in the address space of a different DLL these are the thing you can do.
-if you are using Netwon.dll you can use the memory allocators to make sure that all allocation are performed in the address apace of your main executable.
You do that like this form the SDk
- Code: Select all
// memory allocation for Newton
void* PhysicsAlloc (int sizeInBytes)
{
g_memory += sizeInBytes;
return malloc (sizeInBytes);
}
// memory de-allocation for Newton
void PhysicsFree (void *ptr, int sizeInBytes)
{
g_memory -= sizeInBytes;
free (ptr);
}
// before you create the first Netwon world
NewtonSetMemorySystem (PhysicsAlloc, PhysicsFree);
// now newton will allocate all memory in the adress space of this application
NetwonCreateworld();
// The Joint Libarry dll doe no have that fintionality, I will added for nes realese, but you can do two thing,
-overload the globa new/operators, and make call and allocation funtion in you main funtion.
-link the joint library as a static dll.
-use and grabage colletion startegy to delete objects, basically you place the in a delete queue, and tnen you delete thso object after the Newton objects update.