Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cfg/qt.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@
<!-- QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type = Qt::AutoConnection) // static -->
<function name="connect,QObject::connect">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
Expand Down Expand Up @@ -414,6 +415,7 @@
<!-- bool QObject::disconnect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) // static -->
<function name="disconnect,QObject::disconnect">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
Expand Down Expand Up @@ -445,6 +447,7 @@
<function name="QMenu::addAction">
<noreturn>false</noreturn>
<returnValue type="QAction *"/>
<leak-ignore/>
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
Expand Down
1 change: 1 addition & 0 deletions gui/helpdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,5 @@ HelpDialog::HelpDialog(QWidget *parent) :
HelpDialog::~HelpDialog()
{
delete mUi;
delete mHelpEngine;
}
4 changes: 4 additions & 0 deletions gui/helpdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion lib/checkmemoryleak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 17 additions & 0 deletions test/cfg/qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {};
};
}