Skip to content

Commit 70bedae

Browse files
committed
Fix auto_duplicate not evicting
1 parent f0b1c75 commit 70bedae

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/mnelab/mainwindow.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,10 @@ def auto_duplicate(self):
18231823
"""
18241824
# if current data is stored in a file create a new data set
18251825
if self.model.current["fname"]:
1826+
parent_index = self.model.index
18261827
self.model.duplicate_data()
1828+
if read_settings("memory_saving"):
1829+
self.model.evict_dataset(parent_index)
18271830
return True
18281831
# otherwise ask the user
18291832
msg = QMessageBox(self)
@@ -1848,7 +1851,10 @@ def auto_duplicate(self):
18481851
if msg.clickedButton() == overwrite_button:
18491852
return False
18501853
else:
1854+
parent_index = self.model.index
18511855
self.model.duplicate_data()
1856+
if read_settings("memory_saving"):
1857+
self.model.evict_dataset(parent_index)
18521858
return True
18531859

18541860
def _add_recent(self, fname):

0 commit comments

Comments
 (0)