Skip to content

C++: FP in cpp/resource-not-released-in-destructor #1159

@s0

Description

@s0

As reported here: https://discuss.lgtm.com/t/false-positive-resource-not-released-in-destructor/1938

https://lgtm.com/projects/g/KDE/kphotoalbum/snapshot/fe21e4ad620bf50c37ed9b9ec38a1941eb9b5fac/files/Exif/Database.cpp#x7903eb9a495cd189:1 2

In this case, the boolean member variable m_isOpen is mistaken for the resource that is acquired, when in fact the QSqlDatabase m_db holds the resource (and is correctly released in the dtor).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions