[nostalgia/core/studio] Fix memory leaks

This commit is contained in:
2020-08-28 21:35:38 -05:00
parent f15ad04d33
commit cef8c54515
4 changed files with 49 additions and 38 deletions
@@ -8,11 +8,21 @@
#pragma once
#include <QStyledItemDelegate>
#include <nostalgia/core/gfx.hpp>
#include <nostalgia/studio/studio.hpp>
namespace nostalgia::core {
struct PaletteEditorColorTableDelegate: public QStyledItemDelegate {
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem&, const QModelIndex &idx) const;
void paint(QPainter *painter, const QStyleOptionViewItem &opt, const QModelIndex &idx) const;
};
class PaletteEditor: public studio::Editor {
friend class AddColorCommand;
@@ -21,6 +31,7 @@ class PaletteEditor: public studio::Editor {
friend class MoveColorCommand;
private:
PaletteEditorColorTableDelegate m_colorTableDelegate;
const studio::Context *m_ctx = nullptr;
QString m_itemPath;
std::unique_ptr<NostalgiaPalette> m_pal;