Fix memory leak
This commit is contained in:
parent
73eabc92ca
commit
c1e3415417
1 changed files with 3 additions and 1 deletions
|
@ -860,8 +860,10 @@ void TilesetEditor::on_actionPaste_triggered()
|
|||
{
|
||||
Metatile *prevMetatile = new Metatile(*this->metatile);
|
||||
uint16_t metatileId = this->getSelectedMetatileId();
|
||||
if (!this->replaceMetatile(metatileId, this->copiedMetatile))
|
||||
if (!this->replaceMetatile(metatileId, this->copiedMetatile)) {
|
||||
delete prevMetatile;
|
||||
return;
|
||||
}
|
||||
|
||||
MetatileHistoryItem *commit = new MetatileHistoryItem(metatileId, prevMetatile, new Metatile(*this->metatile));
|
||||
metatileHistory.push(commit);
|
||||
|
|
Loading…
Reference in a new issue