mirror of
https://github.com/rrika/cdcEngineDXHR.git
synced 2024-11-23 05:29:57 +00:00
reference counting fixes
This commit is contained in:
parent
2353178ba1
commit
ebe4df653f
@ -201,7 +201,7 @@ SoundHandle SoundPlexCollection::StartPaused( // 178
|
||||
|
||||
if (plex) {
|
||||
// TODO
|
||||
m_plexes.push_back(owner);
|
||||
m_plexes.emplace_back(owner);
|
||||
// TODO
|
||||
|
||||
return owner; // calls cdc::Handle<SoundOwner>::Handle(SoundOwner*)
|
||||
|
@ -57,7 +57,7 @@ void SoundPlexWave::End(SoundPlexWave::EndType end) {
|
||||
case k4:
|
||||
case k5:
|
||||
case k6:
|
||||
delete m_voice; // call VoiceImpl::~VoiceImpl
|
||||
delete static_cast<VoiceImpl*>(m_voice); // call VoiceImpl::~VoiceImpl
|
||||
m_voice = nullptr;
|
||||
default:
|
||||
return;
|
||||
|
@ -240,6 +240,7 @@ void VoiceCollection::Remove(VoiceImpl *voice) { // line 1260
|
||||
// link0 -> voice0
|
||||
// ...
|
||||
|
||||
VoiceImpl *voice0 = *nextIt;
|
||||
m_voices.erase(voice->it);
|
||||
|
||||
// iterator <- (voice1)
|
||||
@ -248,7 +249,7 @@ void VoiceCollection::Remove(VoiceImpl *voice) { // line 1260
|
||||
// link0 -> voice0
|
||||
// ...
|
||||
|
||||
nextIt->it = voice->it;
|
||||
voice0->it = voice->it;
|
||||
|
||||
// iterator <- (voice1)
|
||||
// | `---.
|
||||
|
@ -90,7 +90,7 @@ private:
|
||||
friend void InitHandlePool(uint32_t count);
|
||||
friend bool IsHandlePoolValid();
|
||||
|
||||
HandleData() : m_object(nullptr), m_refCount(9) {} // line 297
|
||||
HandleData() : m_object(nullptr), m_refCount(0) {} // line 297
|
||||
HandleData(HandleData const&); // line 298
|
||||
HandleData& operator=(HandleData const&); // line 299
|
||||
|
||||
@ -117,8 +117,10 @@ public:
|
||||
inline HandleOwner::HandleOwner() : m_handle(0) {} // line 345
|
||||
|
||||
inline HandleOwner::~HandleOwner() { // ?
|
||||
if (m_handle)
|
||||
if (m_handle) {
|
||||
HandleData::s_handles[m_handle].m_object = nullptr;
|
||||
HandleData::s_handles[m_handle].RemReference();
|
||||
}
|
||||
}
|
||||
|
||||
inline void HandleOwner::CreateHandle(void *object) { // line 364
|
||||
|
Loading…
Reference in New Issue
Block a user