Project

General

Profile

Actions

Cleanup #57501

open

dbstore: please use unique_ptr instead of new/delete pairs in DBZone

Added by Yuval Lifshitz over 1 year ago. Updated 8 months ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

currently copying a DBZone object would cause double delete.
also, using new/delete may cause resource leak and considered back practice

coverity CID 1512314

Actions #1

Updated by Matt Benjamin over 1 year ago

new and delete are not deprecated

Actions #2

Updated by Matt Benjamin over 1 year ago

(unique_ptr is often a good idea, but let's not become completely prescriptive)

Actions #3

Updated by Casey Bodley over 1 year ago

currently copying a DBZone object would cause double delete

none of these sal objects should be copyable. let's explicitly disable copy on the sal base classes so we don't accidentally do this

Actions #4

Updated by Yuval Lifshitz over 1 year ago

would still recommend using unique_ptr in this case (don't see any justification to use new/delete pair here).

Actions #5

Updated by Yuval Lifshitz 8 months ago

  • Tracker changed from Bug to Cleanup
Actions

Also available in: Atom PDF