Skip to content

Commit bdb3231

Browse files
committed
Implements a virtual destructor on the BaseRequestHandler class.
Implements a virtual destructor on the BaseRequestHandler class to protect against undefined behavior in the event that a derived BaseRequestHandler class has a destructor and an object of such derived class is destroyed through a pointer to its base class.
1 parent d9fdac1 commit bdb3231

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)