• Advertisement
Sign in to follow this  

CoUninitialize - Circustances when it fails?

This topic is 4484 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
CoUninitialize has a void return type, so it cannot fail. In any regard, you shouldn't care whether it fails or not, since you should be calling it at the very end of your application when you shut your other systems down. It *may* crash your software if you don't pair it with an CoInitialize, so make sure you call CoInitialize the same number of times that you call CoUninitialize.

Share this post


Link to post
Share on other sites
I've figured it out - take note any ogre developers.

Things must be created and destroyed in this order to prevent exceptions

Create OpenAL stuff
Create Ogre Stuff

... use it all ...

Cleanup OpenAL stuff
Cleanup Ogre stuff.


This kind of goes against what I usually do with matching construction and destruction in reverse order... my guessing is that Ogre must do something when cleaning up that screws up OpenALs CoUinitialize call. Running the application in this order of creation and deletion seems to mean that both ogre and openal are happy and exceptionless (as far as I can tell anyway).

I was blaming openal because it was the first to complain and stuff, but obviously ogre can't be playing very nice.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement