From 754074ae779473590a6a33ad33501ad1b703b041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Fri, 13 Sep 2019 17:12:12 +0200 Subject: [PATCH] Fix documentation example code --- libnymea-gpio/gpiobutton.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libnymea-gpio/gpiobutton.cpp b/libnymea-gpio/gpiobutton.cpp index 2bfaa2f..ffe6e38 100644 --- a/libnymea-gpio/gpiobutton.cpp +++ b/libnymea-gpio/gpiobutton.cpp @@ -35,6 +35,8 @@ button->setName("User button"); if (!button->enable()) { qWarning() << "Could not enable the" << this; + button->deleteLater(); + return; } connect(button, &GpioButton::clicked, this, [this, button](){