Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2008-03-01 22:29:01 +0300
committerBenoit Bolsee <benoit.bolsee@online.be>2008-03-01 22:29:01 +0300
commit44314581dc934dc99c9504edf671118a9f988b68 (patch)
tree6ca6c26b53e32e5fc0ddca6c355d1f01a4f93125
parent3cf5b1d6fb87f0eac94893dbe8b9fff688eac54e (diff)
Mem leak fixed in sound buffer & parent invert node
-rw-r--r--intern/SoundSystem/openal/SND_OpenALDevice.cpp12
-rw-r--r--source/gameengine/SceneGraph/SG_IObject.cpp5
2 files changed, 11 insertions, 6 deletions
diff --git a/intern/SoundSystem/openal/SND_OpenALDevice.cpp b/intern/SoundSystem/openal/SND_OpenALDevice.cpp
index a278384dfd8..bb0204af53b 100644
--- a/intern/SoundSystem/openal/SND_OpenALDevice.cpp
+++ b/intern/SoundSystem/openal/SND_OpenALDevice.cpp
@@ -332,12 +332,6 @@ SND_OpenALDevice::~SND_OpenALDevice()
{
MakeCurrent();
- if (m_buffersinitialized)
- {
- alDeleteBuffers(NUM_BUFFERS, m_buffers);
- m_buffersinitialized = false;
- }
-
if (m_sourcesinitialized)
{
for (int i = 0; i < NUM_SOURCES; i++)
@@ -347,6 +341,12 @@ SND_OpenALDevice::~SND_OpenALDevice()
m_sourcesinitialized = false;
}
+ if (m_buffersinitialized)
+ {
+ alDeleteBuffers(NUM_BUFFERS, m_buffers);
+ m_buffersinitialized = false;
+ }
+
if (m_context) {
MakeCurrent();
#ifdef AL_VERSION_1_1
diff --git a/source/gameengine/SceneGraph/SG_IObject.cpp b/source/gameengine/SceneGraph/SG_IObject.cpp
index 232ceb06958..4787847da0d 100644
--- a/source/gameengine/SceneGraph/SG_IObject.cpp
+++ b/source/gameengine/SceneGraph/SG_IObject.cpp
@@ -128,6 +128,11 @@ ActivateDestructionCallback(
// Call client provided destruction function on this!
m_callbacks.m_destructionfunc(this,m_SGclientObject,m_SGclientInfo);
}
+ else
+ {
+ // no callback but must still destroy the node to avoid memory leak
+ delete this;
+ }
}
void