So I am somewhat stumped on this subject and it is appearing in both my implementations of DirectSound and DirectInput at the moment but I am having problems releasing the direct sound object. I am running a toy example of my encapsulation at this point but I will put some of the code here since this is part of a much larger codebase.
To create the DirectSound object I use this snippet member function of the Implementation Class
// First Create the DirectSoundObject
hr = DirectSoundCreate8( NULL,
//CHRM(CoInitializeEx(NULL, 0), "CoInitializeEx");
CHRM(m_pDSound->SetCooperativeLevel(m_hwnd, DSSCL_PRIORITY), "SetCooperativeLevel");
and then when I delete the implementation class this code snippet is called
m_pDSoundBuffer = NULL;
m_pDSound = NULL;
So the way that the implementation is generated is through a factory class which then passes the implementation to an object which contains the sound data. Both implementation and data classes are abstracted but I doubt that this could somehow interfere with DirectSound. Basically what happens is that at program exit the implementatio class is deleted and this code is called but in the end the console simply hangs although it is not running any of my code. It seems like there is something else referencing the DirectSound object but I can't seem to figure out what that is. It definitely is not my code since at this point I have stripped out everything except creating and deleting the DirectSound object.
Any help would be greatly appreciated, thanks!