Results 1 to 6 of 6

Thread: How do you gracefully close a dae?

  1. #1

    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?

    Thanks,
    David

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    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?
    Code :
    DAE* dae = new DAE;
    // do stuff with dae
    delete dae;
    or
    Code :
    void func() {
      DAE dae;
      // dae will be destroyed automatically when func exits
    }

  3. #3
    Thanks,
    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.

    David

  4. #4
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    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.

  5. #5
    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.

    David

  6. #6
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    If you could work that done to a small test case so I could reproduce it, I'd love to fix it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •