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

@@ -53,7 +53,6 @@ NotePlayHandle::NotePlayHandle( InstrumentTrack* instrumentTrack,
PlayHandle( TypeNotePlayHandle, _offset ),
Note( n.length(), n.pos(), n.key(), n.getVolume(), n.getPanning(), n.detuning() ),
m_pluginData( NULL ),
m_filter( NULL ),
m_instrumentTrack( instrumentTrack ),
m_frames( 0 ),
m_totalFramesPlayed( 0 ),
@@ -155,8 +154,6 @@ NotePlayHandle::~NotePlayHandle()
m_subNotes.clear();
delete m_filter;
if( buffer() ) releaseBuffer();
unlock();