Improve cleanup_preview_threads function

This commit is contained in:
Deniz Şafak
2025-11-24 00:46:13 +03:00
parent ed418ac11d
commit 290c265d5e
+4 -3
View File
@@ -1,5 +1,6 @@
import os import os
import time import time
import sys
import tempfile import tempfile
import platform import platform
import base64 import base64
@@ -2847,10 +2848,10 @@ class abogen(QWidget):
# Cleanup pygame mixer if initialized # Cleanup pygame mixer if initialized
try: try:
import pygame pygame = sys.modules.get('pygame')
if pygame.mixer.get_init(): if pygame and pygame.mixer.get_init():
pygame.mixer.quit() pygame.mixer.quit()
except ImportError: except Exception:
pass pass
def closeEvent(self, event): def closeEvent(self, event):