Opened 6 years ago

Closed 6 years ago

#10220 closed bug (invalid)

Added virtual descriptor to DoublyLinkedListImpl, PackageSymlink and PackageDirectory

Reported by: Ezodev Owned by: nobody
Priority: normal Milestone: R1
Component: - General Version: R1/Development
Keywords: gci2013 Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description

empty virtual destructor in DoublyLinkedListImpl:

There is some derivatives, such as PackageNode. If someone assign ptr to PackageNode to DoublyLinkedListImpl<PackageNode>* there will be memleak.

Virtual destructors in PackegeSymlink and PackageDirectory: I don't know if they have childs, but they could have.

I've fount this in Coverity CID:1108472, wanted to fix it but it seems someone was faster, and there is virtual destructor in PackageNode class.

Attachments (1)

0001-Added-virtual-destructor-to-DoublyLinkedListImpl-Pac.patch (1.5 KB) - added by Ezodev 6 years ago.
patch

Download all attachments as: .zip

Change History (3)

comment:1 Changed 6 years ago by Ezodev

Has a Patch: set

Hmm, but on coverity it complains about absence of virtual dest. In PackageSymlink, not his parent. So it probavbly has childs.

Last edited 6 years ago by Ezodev (previous) (diff)

comment:2 Changed 6 years ago by bonefish

Resolution: invalid
Status: newclosed

DoublyLinkedListImpl intentionally doesn't have a virtual destructor, since it shall be usable also for classes that aren't supposed to be polymorphic.

The missing virtual keyword for the PackageNode destructor has been added in 6ef9697b0028d73bf381f4b2dde87dd407c552bc. Derived classes automatically inherit the virtual destructor, so theirs doesn't need to be marked anymore.

Note: See TracTickets for help on using tickets.