bitcoin-qt icon indicating copy to clipboard operation
bitcoin-qt copied to clipboard

Compiler error with gcc 4.7 (missing virtual d'tor) + fix

Open philipbel opened this issue 11 years ago • 1 comments

src/init.cpp:64:16: warning: deleting object of polymorphic class type ‘CWallet’ which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]

Fix is:

diff --git a/src/keystore.h b/src/keystore.h
index 669bf90..9d6576d 100644
--- a/src/keystore.h
+++ b/src/keystore.h
@@ -15,6 +15,8 @@ protected:
     mutable CCriticalSection cs_KeyStore;

 public:
+    virtual ~CKeyStore() { };
+
     // Add a key to the store.
     virtual bool AddKey(const CKey& key) =0;

philipbel avatar Aug 22 '12 10:08 philipbel

Please file issues upstream at https://github.com/bitcoin/bitcoin.

This repository is no longer active.

Also, it has been solved there already.

laanwj avatar Aug 22 '12 10:08 laanwj