Skip to content

Commit 1a27c79

Browse files
committed
mark tempfile before deleting
1 parent c88144c commit 1a27c79

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Source/Heavy/ExporterBase.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ struct ExporterBase : public Component
3131

3232
bool validPatchSelected = false;
3333
bool canvasDirty = false;
34+
bool isTempFile = false;
3435

3536
File patchFile;
3637
File openedPatchFile;
@@ -95,6 +96,7 @@ struct ExporterBase : public Component
9596
realPatchFile = patchFile;
9697
patchFile = openedPatchFile;
9798
canvasDirty = false;
99+
isTempFile = true;
98100
}
99101
else {
100102
canvasDirty = cnv->patch.isDirty();
@@ -121,14 +123,14 @@ struct ExporterBase : public Component
121123
},
122124
"", "HeavyExport", nullptr, true);
123125
};
124-
126+
125127
unsavedLabel.setColour(Label::textColourId, Colours::orange);
126128
addChildComponent(unsavedLabel);
127129
}
128130

129131
~ExporterBase() override
130132
{
131-
if (openedPatchFile.existsAsFile()) {
133+
if (openedPatchFile.existsAsFile() && isTempFile) {
132134
openedPatchFile.deleteFile();
133135
}
134136

0 commit comments

Comments
 (0)