mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
Improve cleanup_preview_threads function
This commit is contained in:
+4
-3
@@ -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):
|
||||||
|
|||||||
Reference in New Issue
Block a user