Skip to content

Commit 1462bde

Browse files
committed
Merge #12050: [trivial] Implements a virtual destructor on the BaseRequestHandler class.
bdb3231 Implements a virtual destructor on the BaseRequestHandler class. (251) Pull request description: Granted that there is no undefined behavior in the current implementation, this PR implements a virtual destructor on the BaseRequestHandler class to protect against undefined behavior in the event that an object of a potential future derived BaseRequestHandler class with a destructor is destroyed through a pointer to this base class. This PR also fixes "_warning: delete called on 'BaseRequestHandler' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]_" warnings in environments where the project is built with the `-Wsystem-headers` flag; or environments where the `-Wdelete-non-virtual-dtor` diagnostics flag fires from system headers. Tree-SHA512: 3c3b0797a8dbce8d8c5b244709e8bca41c4e28d5ba554a974bf7fc9128413e1098c457a00e51b21154ce6c11ce5da3071626e71d593b2550d0020bc589406eed
2 parents 5ad3205 + bdb3231 commit 1462bde

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/bitcoin-cli.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ static void http_error_cb(enum evhttp_request_error err, void *ctx)
198198
class BaseRequestHandler
199199
{
200200
public:
201+
virtual ~BaseRequestHandler() {}
201202
virtual UniValue PrepareRequest(const std::string& method, const std::vector<std::string>& args) = 0;
202203
virtual UniValue ProcessReply(const UniValue &batch_in) = 0;
203204
};

0 commit comments

Comments
 (0)