Page MenuHomePhabricator

Add missing virtual destructor in PeerLogicValidation
ClosedPublic

Authored by deadalnix on Sep 12 2018, 13:46.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Branch
corepr12680
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3281
Build 4648: Bitcoin ABC Buildbot (legacy)
Build 4647: arc lint + arc unit