How do you gracefully close a dae?

Neither the one exporter sample, nor the programmers doc gives an example of deleteing a dae.
So far, any combination of unload, clear and delete the dae object crashes on the delete.
Unfortuneately, I have found that a lot of my load issues have been due to having two active dae objects.

If I export a model via a dae, I can not run my importer that creates another without it crashing. I have to restart the app to load and then import, or to import more than one dae file.

What is the correct way to shutdown and delete a dae object?


Multiple DAE objects will crash the DOM. It’s a known bug. I haven’t gotten the time to fix it unfortunately, but I’m going to try to take care of it this month.

What is the correct way to shutdown and delete a dae object?

DAE* dae = new DAE;
// do stuff with dae
delete dae;


void func() {
  DAE dae;
  // dae will be destroyed automatically when func exits

delete dae; always crashed,
so I tried-

DAE dae;
DAE *daeObject; (Since my code is already using this pointer everywhere)
daeObject = &dae;

And then the auto destructor works fine at the end of the function.

So problem gone, by not using the explicit delete.


The problem probably wasn’t with the delete, but with the multiple DAE objects. That’d lead to crashes. Other than the multiple DAE problem, you should be able to use delete like normal. If not, something’s seriously wrong.

I saw the multiple dae problem when I would run an export and not delete the dae (because it would crash when I did) and then try to run my importer to load the file back, which created a second dae. This would error at different points.

If I closed my app and then imported the file it worked fine - the two dae issue.

I only create one in the exporter or importer, but at the end of that function if I tried to delete the dae created by new, it would always crash. So I found the other error, since I could not delete the dae I had created at the beginning on the importer or exporter. I also tried clear and unload first, but delete still crashed.

But it is working fine by declaring it on the stack and not with the explicit new.
I can run one function and then the other with no errors.


If you could work that done to a small test case so I could reproduce it, I’d love to fix it.