From: <sag...@us...> - 2014-09-09 19:36:40
|
Revision: 4274 http://sourceforge.net/p/modplug/code/4274 Author: saga-games Date: 2014-09-09 19:36:34 +0000 (Tue, 09 Sep 2014) Log Message: ----------- [Ref] Remove pointless reference counting mechanism in VST plugin class. Modified Paths: -------------- trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/Vstplug.h trunk/OpenMPT/soundlib/plugins/PlugInterface.h Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2014-09-09 10:00:31 UTC (rev 4273) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2014-09-09 19:36:34 UTC (rev 4274) @@ -661,7 +661,6 @@ //----------------------------------------------------------------------------------------------------------- { m_hLibrary = hLibrary; - m_nRefCount = 1; m_pPrev = nullptr; m_pNext = nullptr; m_pMixStruct = &mixStruct; @@ -831,9 +830,6 @@ CVstPlugin::~CVstPlugin() //----------------------- { -#ifdef VST_LOG - Log("~CVstPlugin: m_nRefCount=%d\n", m_nRefCount); -#endif CriticalSection cs; if (m_pEditor) @@ -875,22 +871,16 @@ } -size_t CVstPlugin::Release() -//-------------------------- +void CVstPlugin::Release() +//------------------------ { - if(!(--m_nRefCount)) + try { - try - { - delete this; - } catch (...) - { - ReportPlugException(L"Exception while destroying plugin!"); - } - - return 0; + delete this; + } catch (...) + { + ReportPlugException(L"Exception while destroying plugin!"); } - return m_nRefCount; } Modified: trunk/OpenMPT/mptrack/Vstplug.h =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.h 2014-09-09 10:00:31 UTC (rev 4273) +++ trunk/OpenMPT/mptrack/Vstplug.h 2014-09-09 19:36:34 UTC (rev 4274) @@ -168,7 +168,6 @@ CAbstractVstEditor *m_pEditor; CSoundFile &m_SndFile; - size_t m_nRefCount; uint32 m_nSampleRate; SNDMIXPLUGINSTATE m_MixState; @@ -258,8 +257,7 @@ size_t GetInputChannelList(std::vector<CHANNELINDEX> &list); public: - size_t AddRef() { return ++m_nRefCount; } - size_t Release(); + void Release(); void SaveAllParameters(); void RestoreAllParameters(long nProg=-1); void RecalculateGain(); Modified: trunk/OpenMPT/soundlib/plugins/PlugInterface.h =================================================================== --- trunk/OpenMPT/soundlib/plugins/PlugInterface.h 2014-09-09 10:00:31 UTC (rev 4273) +++ trunk/OpenMPT/soundlib/plugins/PlugInterface.h 2014-09-09 19:36:34 UTC (rev 4274) @@ -38,8 +38,7 @@ //============== { public: - virtual size_t AddRef() = 0; - virtual size_t Release() = 0; + virtual void Release() = 0; virtual void SaveAllParameters() = 0; virtual void RestoreAllParameters(long nProg=-1) = 0; //rewbs.plugDefaultProgram: added param virtual void Process(float *pOutL, float *pOutR, size_t nSamples) = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |