diff --git a/cfg/qt.cfg b/cfg/qt.cfg index f944411a1..43feea299 100644 --- a/cfg/qt.cfg +++ b/cfg/qt.cfg @@ -383,6 +383,7 @@ false + @@ -414,6 +415,7 @@ false + @@ -445,6 +447,7 @@ false + diff --git a/gui/helpdialog.cpp b/gui/helpdialog.cpp index bf5b1c5cf..e9aac0689 100644 --- a/gui/helpdialog.cpp +++ b/gui/helpdialog.cpp @@ -112,4 +112,5 @@ HelpDialog::HelpDialog(QWidget *parent) : HelpDialog::~HelpDialog() { delete mUi; + delete mHelpEngine; } diff --git a/gui/helpdialog.h b/gui/helpdialog.h index a3dd21269..bbc77ce28 100644 --- a/gui/helpdialog.h +++ b/gui/helpdialog.h @@ -33,6 +33,10 @@ namespace Ui { class HelpBrowser : public QTextBrowser { public: explicit HelpBrowser(QWidget* parent = nullptr) : QTextBrowser(parent), mHelpEngine(nullptr) {} + HelpBrowser(const HelpBrowser&) = delete; + HelpBrowser(HelpBrowser&&) = delete; + HelpBrowser& operator=(const HelpBrowser&) = delete; + HelpBrowser& operator=(HelpBrowser&&) = delete; void setHelpEngine(QHelpEngine *helpEngine); QVariant loadResource(int type, const QUrl& name) override; private: diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index 6ce4fa872..ba877ea14 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -1027,7 +1027,10 @@ void CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(const Scope *scope) break; arg = arg->astOperand1(); } - if (getAllocationType(arg, 0) == No) + const AllocType alloc = getAllocationType(arg, 0); + if (alloc == No) + continue; + if ((alloc == New || alloc == NewArray) && arg->next() && !(arg->next()->isStandardType() || mSettings->library.detectContainerOrIterator(arg))) continue; if (isReopenStandardStream(arg)) continue; diff --git a/test/cfg/qt.cpp b/test/cfg/qt.cpp index 57566e6cc..736fbf2ee 100644 --- a/test/cfg/qt.cpp +++ b/test/cfg/qt.cpp @@ -470,3 +470,20 @@ void nullPointer(int * pIntPtr) *pIntPtr = 3; } } + +namespace { + class C : public QObject { + Q_OBJECT + public: + explicit C(QObject* parent = nullptr) : QObject(parent) {} + void signal() {} + }; + class D : public QObject { + Q_OBJECT + public: + D() { + connect(new C(this), &C::signal, this, &D::slot); + } + void slot() {}; + }; +}