Deallocation fixes and simplification

This commit is contained in:
Jack Andersen
2016-05-16 12:13:24 -10:00
parent 531961be78
commit 2192d45da1
7 changed files with 65 additions and 28 deletions

View File

@@ -48,6 +48,7 @@ class Engine
std::list<std::shared_ptr<Voice>>::iterator _destroyVoice(Voice* voice);
std::list<std::shared_ptr<Sequencer>>::iterator _destroySequencer(Sequencer* sequencer);
std::list<Submix>::iterator _destroySubmix(Submix* smx);
std::list<Submix>::iterator _removeSubmix(Submix* smx);
void _bringOutYourDead();
public:
~Engine();

View File

@@ -30,8 +30,8 @@ class Entity
* but shared_ptrs are issued to the client so it can safely track state */
friend class Engine;
friend class SoundMacroState;
bool m_destroyed = false;
protected:
bool m_destroyed = false;
void _destroy()
{
#ifndef NDEBUG

View File

@@ -26,9 +26,6 @@ class Submix
Submix* m_submix = nullptr; /**< Parent submix of this submix (or NULL if mixing to main output) */
std::list<Submix>::iterator m_engineIt; /**< Iterator to self within Engine's list for quick deletion */
std::unique_ptr<IBackendSubmix> m_backendSubmix; /**< Handle to client-implemented backend submix */
std::unordered_set<Voice*> m_activeVoices; /**< Secondary index of Voices within Submix */
std::unordered_set<Sequencer*> m_activeSequencers; /**< Secondary index of Sequencers within Submix */
std::unordered_set<Submix*> m_activeSubmixes; /**< Secondary index of Submixes within Submix */
std::vector<std::unique_ptr<EffectBaseTypeless>> m_effectStack; /**< Ordered list of effects to apply to submix */
bool m_destroyed = false;
void _destroy();