diff --git a/opencore_legacy_patcher/constants.py b/opencore_legacy_patcher/constants.py index eeaf9e909..f2512c378 100644 --- a/opencore_legacy_patcher/constants.py +++ b/opencore_legacy_patcher/constants.py @@ -13,7 +13,7 @@ from .detections import device_probe class Constants: def __init__(self) -> None: # Patcher Versioning - self.patcher_version: str = "2.3.2" # OpenCore-Legacy-Patcher + self.patcher_version: str = "2.4.0" # OpenCore-Legacy-Patcher self.patcher_support_pkg_version: str = "1.9.3" # PatcherSupportPkg self.copyright_date: str = "Copyright © 2020-2025 Dortania" self.patcher_name: str = "OpenCore Legacy Patcher" @@ -155,8 +155,7 @@ class Constants: self.unpack_thread = None # Determine if unpack thread finished (threading.Thread) self.update_stage: int = 0 # Determine update stage (see gui_support.py) self.log_filepath: Path = None # Path to log file - self.thread_sleep_interval: float = 0.1 # Sleep interval between UI updates (seconds) - reduce refresh-rate to reduce CPU-usage - self.thread_nap_interval: float = 0.01 # Short Sleep interval between UI updates (seconds) - for faster UI updates of the progress bar + self.thread_sleep_interval: float = 0.01 # Sleep interval between UI updates (seconds) - balance between UI responsiveness and CPU usage self.commit_info: tuple = (None, None, None) # Commit info (Branch, Commit Date, Commit URL) diff --git a/opencore_legacy_patcher/wx_gui/gui_macos_installer_flash.py b/opencore_legacy_patcher/wx_gui/gui_macos_installer_flash.py index 80913b548..d93217070 100644 --- a/opencore_legacy_patcher/wx_gui/gui_macos_installer_flash.py +++ b/opencore_legacy_patcher/wx_gui/gui_macos_installer_flash.py @@ -3,7 +3,6 @@ gui_macos_installer_flash.py: macOS Installer Flash Frame """ import wx -import time import logging import plistlib import tempfile @@ -317,7 +316,7 @@ class macOSInstallerFlashFrame(wx.Frame): wx.CallAfter(progress_bar.SetValue, bytes_written) wx.Yield() - time.sleep(self.constants.thread_sleep_interval) + thread.join(timeout=self.constants.thread_sleep_interval) if self.result is False: logging.error("Failed to flash installer, cannot continue.") diff --git a/opencore_legacy_patcher/wx_gui/gui_support.py b/opencore_legacy_patcher/wx_gui/gui_support.py index 5882833d3..8082c49a9 100644 --- a/opencore_legacy_patcher/wx_gui/gui_support.py +++ b/opencore_legacy_patcher/wx_gui/gui_support.py @@ -273,7 +273,7 @@ def wait_for_thread(thread: threading.Thread, sleep_interval=None): while thread.is_alive(): wx.Yield() - time.sleep(interval) + thread.join(timeout=interval) class RestartHost: