aboutsummaryrefslogtreecommitdiff
path: root/src/validationinterface.h
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2018-03-14 06:04:42 +0100
committerVasil Dimov <vd@FreeBSD.org>2018-03-14 10:11:01 +0100
commit2b3ea39de40bc7754cab558245e4ddac1b261750 (patch)
treeb462c94c233b97a5c024609d48f8b1bc513a4729 /src/validationinterface.h
parent6acd8700bc0ee1d10207a362c1e07372ba274041 (diff)
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(); ^
Diffstat (limited to 'src/validationinterface.h')
-rw-r--r--src/validationinterface.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/validationinterface.h b/src/validationinterface.h
index 56ea698a2e..63097166af 100644
--- a/src/validationinterface.h
+++ b/src/validationinterface.h
@@ -56,6 +56,11 @@ void SyncWithValidationInterfaceQueue();
class CValidationInterface {
protected:
/**
+ * Protected destructor so that instances can only be deleted by derived classes.
+ * If that restriction is no longer desired, this should be made public and virtual.
+ */
+ ~CValidationInterface() = default;
+ /**
* Notifies listeners of updated block chain tip
*
* Called on a background thread.