From 8275d3e74b0b61f45363f3882ab26da35dba6de2 Mon Sep 17 00:00:00 2001 From: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com> Date: Thu, 20 Aug 2026 20:43:57 -0700 Subject: [PATCH] fix: prevent sefaults after progress bar tasks (#1490) --- src/tagstudio/qt/utils/custom_runnable.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tagstudio/qt/utils/custom_runnable.py b/src/tagstudio/qt/utils/custom_runnable.py index 06932bc7..9792fdf1 100644 --- a/src/tagstudio/qt/utils/custom_runnable.py +++ b/src/tagstudio/qt/utils/custom_runnable.py @@ -2,17 +2,23 @@ # SPDX-License-Identifier: GPL-3.0-only +from collections.abc import Callable +from typing import override + from PySide6.QtCore import QObject, QRunnable, Signal class CustomRunnable(QRunnable, QObject): # pyright: ignore[reportUnsafeMultipleInheritance] done = Signal() - def __init__(self, function) -> None: + def __init__(self, function: Callable[..., None]) -> None: QRunnable.__init__(self) QObject.__init__(self) + self.setAutoDelete(False) self.function = function + @override def run(self): self.function() self.done.emit() + self.deleteLater()