Skip to content

Commit

Permalink
Fix memory leak in SE_dragInstrumentAction
Browse files Browse the repository at this point in the history
  • Loading branch information
mauser committed Sep 16, 2019
1 parent 34cd6b0 commit bc49e0f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/gui/src/UndoActions.h
Expand Up @@ -833,18 +833,26 @@ class SE_dragInstrumentAction : public QUndoCommand
__nTargetInstrument = nTargetInstrument;
__addedComponents = new std::vector<int>();
}

~SE_dragInstrumentAction()
{
delete __addedComponents;
}

virtual void undo()
{
//qDebug() << "drop Instrument Undo ";
HydrogenApp* h2app = HydrogenApp::get_instance();
h2app->getPatternEditorPanel()->getDrumPatternEditor()->functionDropInstrumentUndoAction( __nTargetInstrument, __addedComponents );
}

virtual void redo()
{
//qDebug() << "drop Instrument Redo " ;
HydrogenApp* h2app = HydrogenApp::get_instance();
h2app->getPatternEditorPanel()->getDrumPatternEditor()->functionDropInstrumentRedoAction( __sDrumkitName, __sInstrumentName, __nTargetInstrument, __addedComponents );
}

private:
QString __sDrumkitName;
QString __sInstrumentName;
Expand Down

0 comments on commit bc49e0f

Please sign in to comment.