Skip to content

Commit

Permalink
Merge bitcoin#12050: [trivial] Implements a virtual destructor on the…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
laanwj committed Feb 6, 2018
2 parents 5ad3205 + bdb3231 commit 1462bde
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/bitcoin-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ static void http_error_cb(enum evhttp_request_error err, void *ctx)
class BaseRequestHandler
{
public:
virtual ~BaseRequestHandler() {}
virtual UniValue PrepareRequest(const std::string& method, const std::vector<std::string>& args) = 0;
virtual UniValue ProcessReply(const UniValue &batch_in) = 0;
};
Expand Down

0 comments on commit 1462bde

Please sign in to comment.