File tree Expand file tree Collapse file tree 3 files changed +4
-7
lines changed
test/query-tests/jsf/4.10 Classes/AV Rule 79 Expand file tree Collapse file tree 3 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -267,7 +267,7 @@ predicate automaticallyReleased(Assignment acquire)
267267{
268268 // sub-types of the Qt type QObject are released by their parent (if they have one)
269269 exists ( NewExpr alloc |
270- alloc .getType ( ) = qtObject ( ) and
270+ alloc .getAllocatedType ( ) = qtObject ( ) and
271271 acquire .getRValue ( ) = alloc and
272272 alloc .getInitializer ( ) = qtParentConstructor ( ) .getACallToThisFunction ( )
273273 )
Original file line number Diff line number Diff line change 1414| ListDelete.cpp:21:3:21:21 | ... = ... | Resource first is acquired by class MyThingColection but not released anywhere in this class. |
1515| NoDestructor.cpp:23:3:23:20 | ... = ... | Resource n is acquired by class MyClass5 but not released anywhere in this class. |
1616| PlacementNew.cpp:36:3:36:36 | ... = ... | Resource p1 is acquired by class MyTestForPlacementNew but not released anywhere in this class. |
17- | QObject.cpp:16:5:16:46 | ... = ... | Resource noParent is acquired by class MyQtUser but not released anywhere in this class. |
18- | QObject.cpp:20:5:20:54 | ... = ... | Resource constructorParent is acquired by class MyQtUser but not released anywhere in this class. |
19- | QObject.cpp:22:5:22:49 | ... = ... | Resource laterParent is acquired by class MyQtUser but not released anywhere in this class. |
2017| SelfRegistering.cpp:25:3:25:24 | ... = ... | Resource side is acquired by class MyOwner but not released anywhere in this class. |
2118| Variants.cpp:25:3:25:13 | ... = ... | Resource f is acquired by class MyClass4 but not released anywhere in this class. |
2219| Variants.cpp:65:3:65:17 | ... = ... | Resource a is acquired by class MyClass6 but not released anywhere in this class. |
Original file line number Diff line number Diff line change @@ -13,13 +13,13 @@ class MyQtUser {
1313 MyQtUser (QObject *parent) {
1414 // This object sets its parent pointer to null and thus must be deleted
1515 // manually.
16- noParent = new DerivedFromQObject (nullptr ); // BAD
16+ noParent = new DerivedFromQObject (nullptr ); // BAD [NOT DETECTED]
1717
1818 // This object does not need to be deleted because it will be deleted by
1919 // its parent object when the time is right.
20- constructorParent = new DerivedFromQObject (parent); // GOOD [FALSE POSITIVE]
20+ constructorParent = new DerivedFromQObject (parent); // GOOD
2121
22- laterParent = new DerivedFromQObject (nullptr ); // GOOD [FALSE POSITIVE]
22+ laterParent = new DerivedFromQObject (nullptr ); // GOOD
2323 laterParent->setParent (parent);
2424 }
2525};
You can’t perform that action at this time.
0 commit comments