From 644008827afe258bff2ee31f861fef1f0f356f8b Mon Sep 17 00:00:00 2001 From: microcai Date: Thu, 17 Oct 2024 13:32:32 +0800 Subject: [PATCH] x --- libs/qtcoro/qtcoro.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/qtcoro/qtcoro.hpp b/libs/qtcoro/qtcoro.hpp index 679bccc..afe7fed 100644 --- a/libs/qtcoro/qtcoro.hpp +++ b/libs/qtcoro/qtcoro.hpp @@ -160,12 +160,14 @@ namespace qtcoro explicit QPrivateSignal() = default; }; - public slots: - void call() + public: + inline void call() { - deleteLater(); + if (auto_delete) + deleteLater(); func(); } + bool auto_delete { true }; public: MyCallableQObject(Func&& f) : func(std::forward(f)){}