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:
authorJoerg Mueller <nexyon@gmail.com>2012-11-03 13:49:49 +0400
committerJoerg Mueller <nexyon@gmail.com>2012-11-03 13:49:49 +0400
commitb59290a835bc1c5aeeec5e3a535848bd8faeadb2 (patch)
treeddf62e7e6785700b07fab821c3e0ea8dbd3f8ad6 /intern/audaspace
parent7353f8d58e51cc50a1b23b8c16a8024a24056bc3 (diff)
Preparation to use boost::shared_ptr.
Diffstat (limited to 'intern/audaspace')
-rw-r--r--intern/audaspace/OpenAL/AUD_OpenALDevice.cpp33
-rw-r--r--intern/audaspace/intern/AUD_SoftwareDevice.cpp33
2 files changed, 45 insertions, 21 deletions
diff --git a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp
index 12b6d2e4f38..a114d8b8a87 100644
--- a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp
+++ b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp
@@ -174,21 +174,34 @@ bool AUD_OpenALDevice::AUD_OpenALHandle::stop()
if(!m_status)
return false;
- // AUD_XXX Create a reference of our own object so that it doesn't get
- // deleted before the end of this function
- AUD_Reference<AUD_OpenALHandle> This = this;
-
- if(m_status == AUD_STATUS_PLAYING)
- m_device->m_playingSounds.remove(This);
- else
- m_device->m_pausedSounds.remove(This);
+ m_status = AUD_STATUS_INVALID;
alDeleteSources(1, &m_source);
if(!m_isBuffered)
alDeleteBuffers(CYCLE_BUFFERS, m_buffers);
- m_status = AUD_STATUS_INVALID;
- return true;
+ for(AUD_HandleIterator it = m_device->m_playingSounds.begin(); it != m_device->m_playingSounds.end(); it++)
+ {
+ if(it->get() == this)
+ {
+ AUD_Reference<AUD_OpenALHandle> This = *it;
+
+ m_device->m_playingSounds.erase(it);
+
+ return true;
+ }
+ }
+
+ for(AUD_HandleIterator it = m_device->m_pausedSounds.begin(); it != m_device->m_pausedSounds.end(); it++)
+ {
+ if(it->get() == this)
+ {
+ m_device->m_pausedSounds.erase(it);
+ return true;
+ }
+ }
+
+ return false;
}
bool AUD_OpenALDevice::AUD_OpenALHandle::getKeep()
diff --git a/intern/audaspace/intern/AUD_SoftwareDevice.cpp b/intern/audaspace/intern/AUD_SoftwareDevice.cpp
index 14f0c6429e9..1fbd0ad82d2 100644
--- a/intern/audaspace/intern/AUD_SoftwareDevice.cpp
+++ b/intern/audaspace/intern/AUD_SoftwareDevice.cpp
@@ -277,22 +277,33 @@ bool AUD_SoftwareDevice::AUD_SoftwareHandle::stop()
if(!m_status)
return false;
- // AUD_XXX Create a reference of our own object so that it doesn't get
- // deleted before the end of this function
- AUD_Reference<AUD_SoftwareHandle> This = this;
+ m_status = AUD_STATUS_INVALID;
- if(m_status == AUD_STATUS_PLAYING)
+ for(AUD_HandleIterator it = m_device->m_playingSounds.begin(); it != m_device->m_playingSounds.end(); it++)
{
- m_device->m_playingSounds.remove(This);
+ if(it->get() == this)
+ {
+ AUD_Reference<AUD_SoftwareHandle> This = *it;
+
+ m_device->m_playingSounds.erase(it);
- if(m_device->m_playingSounds.empty())
- m_device->playing(m_device->m_playback = false);
+ if(m_device->m_playingSounds.empty())
+ m_device->playing(m_device->m_playback = false);
+
+ return true;
+ }
}
- else
- m_device->m_pausedSounds.remove(This);
- m_status = AUD_STATUS_INVALID;
- return true;
+ for(AUD_HandleIterator it = m_device->m_pausedSounds.begin(); it != m_device->m_pausedSounds.end(); it++)
+ {
+ if(it->get() == this)
+ {
+ m_device->m_pausedSounds.erase(it);
+ return true;
+ }
+ }
+
+ return false;
}
bool AUD_SoftwareDevice::AUD_SoftwareHandle::getKeep()