Fix some crashes on project close

This commit is contained in:
GriffinR 2022-10-27 22:11:10 -04:00
parent ce6abb0a81
commit 37b5656376
2 changed files with 11 additions and 16 deletions

View file

@ -67,10 +67,6 @@ public:
ObjectFrame(ObjectEvent *object, QWidget *parent = nullptr)
: EventFrame(object, parent), object(object) {}
virtual ~ObjectFrame() {
delete this->scriptCompleter;
}
virtual void setup() override;
virtual void initialize() override;
virtual void connectSignals() override;
@ -148,10 +144,6 @@ public:
TriggerFrame(TriggerEvent *trigger, QWidget *parent = nullptr)
: EventFrame(trigger, parent), trigger(trigger) {}
virtual ~TriggerFrame() {
delete this->scriptCompleter;
}
virtual void setup() override;
virtual void initialize() override;
virtual void connectSignals() override;
@ -198,10 +190,6 @@ public:
SignFrame(SignEvent *sign, QWidget *parent = nullptr)
: EventFrame(sign, parent), sign(sign) {}
virtual ~SignFrame() {
delete this->scriptCompleter;
}
virtual void setup() override;
virtual void initialize() override;
virtual void connectSignals() override;

View file

@ -18,12 +18,15 @@ Tileset::Tileset(const Tileset &other)
metatile_attrs_label(other.metatile_attrs_label),
metatile_attrs_path(other.metatile_attrs_path),
tilesImagePath(other.tilesImagePath),
tilesImage(other.tilesImage),
tilesImage(other.tilesImage.copy()),
palettePaths(other.palettePaths),
tiles(other.tiles),
palettes(other.palettes),
palettePreviews(other.palettePreviews)
{
for (auto tile : other.tiles) {
tiles.append(tile.copy());
}
for (auto *metatile : other.metatiles) {
metatiles.append(new Metatile(*metatile));
}
@ -39,12 +42,16 @@ Tileset &Tileset::operator=(const Tileset &other) {
metatile_attrs_label = other.metatile_attrs_label;
metatile_attrs_path = other.metatile_attrs_path;
tilesImagePath = other.tilesImagePath;
tilesImage = other.tilesImage;
tilesImage = other.tilesImage.copy();
palettePaths = other.palettePaths;
tiles = other.tiles;
palettes = other.palettes;
palettePreviews = other.palettePreviews;
tiles.clear();
for (auto tile : other.tiles) {
tiles.append(tile.copy());
}
metatiles.clear();
for (auto *metatile : other.metatiles) {
metatiles.append(new Metatile(*metatile));