HomePhabricator

Add missing virtual destructor in PeerLogicValidation

Description

Add missing virtual destructor in PeerLogicValidation

Summary:
Polish interfaces around PeerLogicValidation

  • Make PeerLogicValidation final to prevent deriving from it [1]
  • Prevent deletions of NetEventsInterface and CValidationInterface objects via a base class pointer

[1] silences the following compiler warning (from Clang 7.0.0):

/usr/include/c++/v1/memory:2285:5: error: delete called on non-final 'PeerLogicValidation' that has

  virtual functions but non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor]
delete __ptr;
^

/usr/include/c++/v1/memory:2598:7: note: in instantiation of member function

'std::__1::default_delete<PeerLogicValidation>::operator()' requested here
__ptr_.second()(__tmp);
^

init.cpp:201:15: note: in instantiation of member function 'std::__1::unique_ptr<PeerLogicValidation,

  std::__1::default_delete<PeerLogicValidation> >::reset' requested here
peerLogic.reset();
              ^

Backport core PR12680

Test Plan:

make check

Reviewers: #bitcoin_abc, schancel

Reviewed By: #bitcoin_abc, schancel

Subscribers: teamcity

Differential Revision: https://reviews.bitcoinabc.org/D1774

Details

Provenance
Vasil Dimov <vd@FreeBSD.org>Authored on Mar 14 2018, 05:04
deadalnixCommitted on Sep 15 2018, 17:22
deadalnixPushed on Sep 15 2018, 17:22
Reviewer
Restricted Project
Differential Revision
D1774: Add missing virtual destructor in PeerLogicValidation
Parents
rABCf39790940e24: boost: drop boost threads for [alert|block|wallet]notify
Branches
Unknown
Tags
Unknown