From f44f1e7922fe27bb4e28da24eedeaee0b6827158 Mon Sep 17 00:00:00 2001 From: Wiebe Cazemier Date: Sun, 6 Mar 2022 11:00:43 +0100 Subject: [PATCH] Fix incorrect heap object throw --- FlashMQTests/mainappthread.cpp | 2 +- FlashMQTests/twoclienttestcontext.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FlashMQTests/mainappthread.cpp b/FlashMQTests/mainappthread.cpp index f00204b..c9fcae2 100644 --- a/FlashMQTests/mainappthread.cpp +++ b/FlashMQTests/mainappthread.cpp @@ -53,6 +53,6 @@ void MainAppThread::waitForStarted() QThread::msleep(10); if (n++ > 500) - throw new std::runtime_error("Waiting for app to start failed."); + throw std::runtime_error("Waiting for app to start failed."); } } diff --git a/FlashMQTests/twoclienttestcontext.cpp b/FlashMQTests/twoclienttestcontext.cpp index af2dc32..b2eebb3 100644 --- a/FlashMQTests/twoclienttestcontext.cpp +++ b/FlashMQTests/twoclienttestcontext.cpp @@ -134,7 +134,7 @@ void TwoClientTestContext::onClientError(const QMQTT::ClientError error) errStr = "Socket timeout"; QString msg = QString("Client %1 error code: %2 (%3). Initiated delayed reconnect.\n").arg(_sender->clientId()).arg(error).arg(errStr); - throw new std::runtime_error(msg.toStdString()); + throw std::runtime_error(msg.toStdString()); } void TwoClientTestContext::onReceiverReceived(const QMQTT::Message &message) -- libgit2 0.21.4