Opened 11 years ago
Closed 11 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: | ||
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)
Change History (3)
by , 11 years ago
Attachment: | 0001-Added-virtual-destructor-to-DoublyLinkedListImpl-Pac.patch added |
---|
comment:1 by , 11 years ago
patch: | 0 → 1 |
---|
Hmm, but on coverity it complains about absence of virtual dest. In PackageSymlink, not his parent. So it probavbly has childs.
comment:2 by , 11 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
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.
patch