Replace more instances new/delete with owning types (#4245)

* Use owning types when possible.

Note: the QByteArray s is detached to mimic previous behavior;
detach() guarantees that the QByteArray uniquely owns its data, since
otherwise it's COW. This may be relevant in case Plugin:instantiate
modifies s.data() -- this way the original QString is safe.

* Make m_filter a unique_ptr.

* Make m_activeRenderer a unique_ptr

* use std::string instead of strcpy + buffers
This commit is contained in:
Colin Wallace
2018-03-15 18:46:55 -07:00
committed by GitHub
parent 80ce77fc91
commit b706ee208d
7 changed files with 29 additions and 36 deletions

View File

@@ -161,9 +161,9 @@ void InstrumentSoundShaping::processAudioBuffer( sampleFrame* buffer,
int old_filter_cut = 0;
int old_filter_res = 0;
if( n->m_filter == NULL )
if( n->m_filter == nullptr )
{
n->m_filter = new BasicFilters<>( Engine::mixer()->processingSampleRate() );
n->m_filter = make_unique<BasicFilters<>>( Engine::mixer()->processingSampleRate() );
}
n->m_filter->setFilterType( m_filterModel.value() );