mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-23 18:23:53 +00:00
Fix crash at shutdown
This commit is contained in:
parent
053074babb
commit
fb95756a50
1 changed files with 11 additions and 1 deletions
|
@ -9,7 +9,7 @@ namespace Mangle {
|
||||||
namespace Sound {
|
namespace Sound {
|
||||||
|
|
||||||
/** This class lets a sound listener (ie. the SoundFactory) track a
|
/** This class lets a sound listener (ie. the SoundFactory) track a
|
||||||
given camera in Ogre3D. The poisition and orientation of the
|
given camera in Ogre3D. The position and orientation of the
|
||||||
listener will be updated to match the camera whenever the camera
|
listener will be updated to match the camera whenever the camera
|
||||||
is moved.
|
is moved.
|
||||||
*/
|
*/
|
||||||
|
@ -27,6 +27,16 @@ namespace Sound {
|
||||||
camera->addListener(this);
|
camera->addListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void unfollowCamera()
|
||||||
|
{
|
||||||
|
// If the camera is null, this object wasn't following a camera.
|
||||||
|
// It doesn't make sense to call unfollow
|
||||||
|
assert(camera != NULL);
|
||||||
|
|
||||||
|
camera->removeListener(this);
|
||||||
|
camera = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Mangle::Sound::SoundFactoryPtr soundFact;
|
Mangle::Sound::SoundFactoryPtr soundFact;
|
||||||
Ogre::Camera *camera;
|
Ogre::Camera *camera;
|
||||||
|
|
Loading…
Reference in a new issue