Commit ee693621a20290d96f9768249c9b6c433f68032a
1 parent
89539bc3
Exists in
master
Not try to close and remove matrix file if aux matrix is not a memmap
Showing
1 changed file
with
4 additions
and
1 deletions
Show diff stats
invesalius/data/slice_.py
@@ -301,7 +301,10 @@ class Slice(metaclass=utils.Singleton): | @@ -301,7 +301,10 @@ class Slice(metaclass=utils.Singleton): | ||
301 | 301 | ||
302 | for name in self.aux_matrices: | 302 | for name in self.aux_matrices: |
303 | m = self.aux_matrices[name] | 303 | m = self.aux_matrices[name] |
304 | - f = m.filename | 304 | + try: |
305 | + f = m.filename | ||
306 | + except AttributeError: | ||
307 | + continue | ||
305 | m._mmap.close() | 308 | m._mmap.close() |
306 | m = None | 309 | m = None |
307 | os.remove(f) | 310 | os.remove(f) |