lib: cpp: mitigate warnings due to non-virtual destructors
Commit 042580f53441efe1bc5c80c89351fcb30740659e removed the
`virtual` keyword from the declaration of `~TConnectedClient()`.
While mostly benign, it does cause a warning in some versions
of GCC, which can throw off CI sometimes when building with
`-Werror`.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
diff --git a/lib/cpp/src/thrift/TNonCopyable.h b/lib/cpp/src/thrift/TNonCopyable.h
index a60f1f0..51c94e2 100644
--- a/lib/cpp/src/thrift/TNonCopyable.h
+++ b/lib/cpp/src/thrift/TNonCopyable.h
@@ -30,7 +30,7 @@
class TNonCopyable {
protected:
TNonCopyable() = default;
- ~TNonCopyable() = default;
+ virtual ~TNonCopyable() = default;
TNonCopyable(const TNonCopyable&) = delete;
TNonCopyable& operator=(const TNonCopyable&) = delete;
diff --git a/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.h b/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.h
index 0bc5eb5..dd9b055 100644
--- a/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.h
+++ b/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.h
@@ -36,7 +36,7 @@
class TConcurrentSendSentry {
public:
explicit TConcurrentSendSentry(TConcurrentClientSyncInfo* sync);
- ~TConcurrentSendSentry();
+ virtual ~TConcurrentSendSentry();
void commit();
@@ -48,7 +48,7 @@
class TConcurrentRecvSentry {
public:
TConcurrentRecvSentry(TConcurrentClientSyncInfo* sync, int32_t seqid);
- ~TConcurrentRecvSentry();
+ virtual ~TConcurrentRecvSentry();
void commit();
diff --git a/lib/cpp/src/thrift/async/TEvhttpServer.h b/lib/cpp/src/thrift/async/TEvhttpServer.h
index c5bf3b6..aecfade 100644
--- a/lib/cpp/src/thrift/async/TEvhttpServer.h
+++ b/lib/cpp/src/thrift/async/TEvhttpServer.h
@@ -50,7 +50,7 @@
*/
TEvhttpServer(std::shared_ptr<TAsyncBufferProcessor> processor, int port);
- ~TEvhttpServer();
+ virtual ~TEvhttpServer();
static void request(struct evhttp_request* req, void* self);
int serve();
diff --git a/lib/cpp/src/thrift/transport/TFileTransport.h b/lib/cpp/src/thrift/transport/TFileTransport.h
index 608cff1..902d906 100644
--- a/lib/cpp/src/thrift/transport/TFileTransport.h
+++ b/lib/cpp/src/thrift/transport/TFileTransport.h
@@ -123,7 +123,7 @@
class TFileTransportBuffer {
public:
TFileTransportBuffer(uint32_t size);
- ~TFileTransportBuffer();
+ virtual ~TFileTransportBuffer();
bool addEvent(eventInfo* event);
eventInfo* getNext();
diff --git a/lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h b/lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h
index 057f623..7326a9c 100644
--- a/lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h
+++ b/lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h
@@ -105,7 +105,7 @@
// thread details
private:
TOverlappedSubmissionThread();
- ~TOverlappedSubmissionThread();
+ virtual ~TOverlappedSubmissionThread();
void run();
static unsigned __stdcall thread_proc(void* addr);
@@ -122,7 +122,7 @@
public:
TAutoOverlapThread() : p(TOverlappedSubmissionThread::acquire_instance()) {}
- ~TAutoOverlapThread() { TOverlappedSubmissionThread::release_instance(); }
+ virtual ~TAutoOverlapThread() { TOverlappedSubmissionThread::release_instance(); }
TOverlappedSubmissionThread* operator->() { return p; }
};
}
diff --git a/lib/cpp/src/thrift/windows/Sync.h b/lib/cpp/src/thrift/windows/Sync.h
index a5b2ac5..89aaead 100644
--- a/lib/cpp/src/thrift/windows/Sync.h
+++ b/lib/cpp/src/thrift/windows/Sync.h
@@ -58,7 +58,7 @@
struct TCriticalSection : apache::thrift::TNonCopyable {
CRITICAL_SECTION cs;
TCriticalSection() { InitializeCriticalSection(&cs); }
- ~TCriticalSection() { DeleteCriticalSection(&cs); }
+ virtual ~TCriticalSection() { DeleteCriticalSection(&cs); }
};
class TAutoCrit : apache::thrift::TNonCopyable {
@@ -67,7 +67,7 @@
public:
explicit TAutoCrit(TCriticalSection& cs) : cs_(&cs.cs) { EnterCriticalSection(cs_); }
- ~TAutoCrit() { LeaveCriticalSection(cs_); }
+ virtual ~TAutoCrit() { LeaveCriticalSection(cs_); }
};
struct TAutoResetEvent : apache::thrift::TNonCopyable {
@@ -80,7 +80,7 @@
throw apache::thrift::concurrency::SystemResourceException("CreateEvent failed");
}
}
- ~TAutoResetEvent() { CloseHandle(h); }
+ virtual ~TAutoResetEvent() { CloseHandle(h); }
};
struct TManualResetEvent : apache::thrift::TNonCopyable {
@@ -93,7 +93,7 @@
throw apache::thrift::concurrency::SystemResourceException("CreateEvent failed");
}
}
- ~TManualResetEvent() { CloseHandle(h); }
+ virtual ~TManualResetEvent() { CloseHandle(h); }
};
struct TAutoHandle : apache::thrift::TNonCopyable {
diff --git a/lib/cpp/src/thrift/windows/TWinsockSingleton.h b/lib/cpp/src/thrift/windows/TWinsockSingleton.h
index a098d2c..a8e517a 100644
--- a/lib/cpp/src/thrift/windows/TWinsockSingleton.h
+++ b/lib/cpp/src/thrift/windows/TWinsockSingleton.h
@@ -54,7 +54,7 @@
TWinsockSingleton(void);
public:
- ~TWinsockSingleton(void);
+ virtual ~TWinsockSingleton(void);
public:
static void create(void);