Undo revision 23130 which was a merge with 2.5, a messy one because I did something...
[blender.git] / source / gameengine / GamePlayer / common / GPC_Engine.cpp
index 85a362d..a46f30c 100644 (file)
@@ -58,6 +58,7 @@
 #include "NG_LoopBackNetworkDeviceInterface.h"
 
 #include "RAS_IRenderTools.h"
 #include "NG_LoopBackNetworkDeviceInterface.h"
 
 #include "RAS_IRenderTools.h"
+#include "SND_DeviceManager.h"
 
 #include "GPC_Engine.h"
 #include "GPC_KeyboardDevice.h"
 
 #include "GPC_Engine.h"
 #include "GPC_KeyboardDevice.h"
@@ -74,7 +75,8 @@ GPC_Engine::GPC_Engine(char *customLoadingAnimationURL,
                m_system(NULL), m_keyboarddev(NULL),
                m_mousedev(NULL), m_canvas(NULL), m_rendertools(NULL),
                m_portal(NULL), m_sceneconverter(NULL), m_networkdev(NULL),
                m_system(NULL), m_keyboarddev(NULL),
                m_mousedev(NULL), m_canvas(NULL), m_rendertools(NULL),
                m_portal(NULL), m_sceneconverter(NULL), m_networkdev(NULL),
-               m_curarea(NULL), m_customLoadingAnimationURL(NULL),
+               m_audiodevice(NULL), m_curarea(NULL),
+               m_customLoadingAnimationURL(NULL),
                m_foregroundColor(foregroundColor), m_backgroundColor(backgroundColor),
                m_frameRate(frameRate),
                m_BlenderLogo(0), m_Blender3DLogo(0)/*, m_NaNLogo(0)*/
                m_foregroundColor(foregroundColor), m_backgroundColor(backgroundColor),
                m_frameRate(frameRate),
                m_BlenderLogo(0), m_Blender3DLogo(0)/*, m_NaNLogo(0)*/
@@ -199,6 +201,7 @@ bool GPC_Engine::StartKetsji(void)
                        m_keyboarddev,
                        m_mousedev,
                        m_networkdev,
                        m_keyboarddev,
                        m_mousedev,
                        m_networkdev,
+                       m_audiodevice,
                        m_system);
 
        m_system->SetMainLoop(m_portal->m_ketsjieng);
                        m_system);
 
        m_system->SetMainLoop(m_portal->m_ketsjieng);
@@ -334,6 +337,12 @@ void GPC_Engine::Exit()
                m_networkdev = 0;
        }
 
                m_networkdev = 0;
        }
 
+       if (m_audiodevice)
+       {
+               SND_DeviceManager::Unsubscribe();
+               m_audiodevice = 0;
+       }
+
        m_initialized = false;
 }
 
        m_initialized = false;
 }