From d8e2582889bef31ea1646d1fd1de883dc5d71d63 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Mon, 21 Mar 2022 15:50:28 +0100 Subject: [PATCH] qt gui: (maybe fix) opening "Preferences" segfaults on macOS for some see https://github.com/spesmilo/electrum/issues/7725 related https://github.com/Electron-Cash/Electron-Cash/pull/1545 --- electrum/gui/qt/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/electrum/gui/qt/__init__.py b/electrum/gui/qt/__init__.py index 0eab2af273d..80859d90b02 100644 --- a/electrum/gui/qt/__init__.py +++ b/electrum/gui/qt/__init__.py @@ -42,6 +42,14 @@ from PyQt5.QtCore import QObject, pyqtSignal, QTimer, Qt import PyQt5.QtCore as QtCore +try: + # Preload QtMultimedia at app start, if available. + # We use QtMultimedia on some platforms for camera-handling, and + # lazy-loading it later led to some crashes. Maybe due to bugs in PyQt5. (see #7725) + from PyQt5.QtMultimedia import QCameraInfo; del QCameraInfo +except ImportError as e: + pass # failure is ok; it is an optional dependency. + from electrum.i18n import _, set_language from electrum.plugin import run_hook from electrum.base_wizard import GoBack