We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f2c359 commit 8336350Copy full SHA for 8336350
src/sounddevice.py
@@ -51,6 +51,7 @@
51
__version__ = '0.5.4'
52
53
import atexit as _atexit
54
+import contextlib as _contextlib
55
import os as _os
56
import platform as _platform
57
import sys as _sys
@@ -2649,8 +2650,10 @@ def callback_exit(self):
2649
2650
def finished_callback(self):
2651
self.event.set()
2652
# Drop temporary audio buffers to free memory
- del self.data
2653
- del self.out
+ with _contextlib.suppress(AttributeError):
2654
+ del self.data
2655
2656
+ del self.out
2657
# Drop CFFI objects to avoid reference cycles
2658
self.stream._callback = None
2659
self.stream._finished_callback = None
0 commit comments