diff --git a/src/kdbindings/signal.h b/src/kdbindings/signal.h index beb0845..feec999 100644 --- a/src/kdbindings/signal.h +++ b/src/kdbindings/signal.h @@ -376,14 +376,10 @@ class Signal */ KDBINDINGS_WARN_UNUSED ConnectionHandle connectSingleShot(std::function const &slot) { - ensureImpl(); - - auto singleShotSlot = [slot](ConnectionHandle &handle, Args... args) { + return connectReflective([slot](ConnectionHandle &handle, Args... args) { handle.disconnect(); slot(args...); - }; - - return ConnectionHandle{ m_impl, m_impl->connectReflective(singleShotSlot) }; + } } /**