kaneyxt
09-03-2010 02:20:12
I am using NxOgre in my program, and always get a crash after create/release NxOgre world for 10 times. This crash looks like some static memory buffer overflowing problem, here are some details:
1. My program is a MFC-based application, and NxOgre.lib is linked to the final exe file directly. So when my program starts, the NxOgre.dll, NxCooking.dll, PhysXLoader.dll will be loaded automatically. But at this time, there is no NxOgre world at all.
2. Then I can go to a windows which has a NxOgre world. In this world, I create one NxOgre Scene which has about 30 triggers and several dynamic actors. All the triggers are convex mesh, each mesh has about 20-50 vertexes. When the first time NxOgre world is created, PhysXCooking.dll and PhysXCore.dll will be loaded.
3. Then I quit the window and NxOgre world will be released, I call NxOgre::World::destroyWorld(true). But at this time, PhysXCooking.dll and PhysXCore.dll will NOT be unloaded!
4. I repeat step 2 and 3 for 10 times, at the 11th time, the program will crash!
So I guess maybe this crash is related to the memory buffer for convex mesh cooking or mesh management. As far as I know, PhysX has some vertex limit for convex mesh. If you do not unload PhysXCooking.dll and PhysXCore.dll, but just cook/create convex mesh again and again, some static memory buffer may be used up and cause the crash. Or is there similar problem in NxOgre's own mesh management system?
I know this is maybe a strange usage of NxOgre, but I also think this is a serious problem of NxOgre's constructure. As when I intergrate PhysX into other engine, such as Unreal3 and Gamebryo, after one scene is released, I always unload PhysXCooking and PhysXCore.
1. My program is a MFC-based application, and NxOgre.lib is linked to the final exe file directly. So when my program starts, the NxOgre.dll, NxCooking.dll, PhysXLoader.dll will be loaded automatically. But at this time, there is no NxOgre world at all.
2. Then I can go to a windows which has a NxOgre world. In this world, I create one NxOgre Scene which has about 30 triggers and several dynamic actors. All the triggers are convex mesh, each mesh has about 20-50 vertexes. When the first time NxOgre world is created, PhysXCooking.dll and PhysXCore.dll will be loaded.
3. Then I quit the window and NxOgre world will be released, I call NxOgre::World::destroyWorld(true). But at this time, PhysXCooking.dll and PhysXCore.dll will NOT be unloaded!
4. I repeat step 2 and 3 for 10 times, at the 11th time, the program will crash!
So I guess maybe this crash is related to the memory buffer for convex mesh cooking or mesh management. As far as I know, PhysX has some vertex limit for convex mesh. If you do not unload PhysXCooking.dll and PhysXCore.dll, but just cook/create convex mesh again and again, some static memory buffer may be used up and cause the crash. Or is there similar problem in NxOgre's own mesh management system?
I know this is maybe a strange usage of NxOgre, but I also think this is a serious problem of NxOgre's constructure. As when I intergrate PhysX into other engine, such as Unreal3 and Gamebryo, after one scene is released, I always unload PhysXCooking and PhysXCore.