Skip to content

Commit

Permalink
lib: cpp: mitigate warnings due to non-virtual destructors
Browse files Browse the repository at this point in the history
Commit 042580f 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 <[email protected]>
  • Loading branch information
cfriedt authored and Jens-G committed Jul 13, 2024
1 parent 86b05bf commit db37125
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/cpp/src/thrift/TNonCopyable.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace thrift {
class TNonCopyable {
protected:
TNonCopyable() = default;
~TNonCopyable() = default;
virtual ~TNonCopyable() = default;

TNonCopyable(const TNonCopyable&) = delete;
TNonCopyable& operator=(const TNonCopyable&) = delete;
Expand Down
4 changes: 2 additions & 2 deletions lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TConcurrentClientSyncInfo;
class TConcurrentSendSentry {
public:
explicit TConcurrentSendSentry(TConcurrentClientSyncInfo* sync);
~TConcurrentSendSentry();
virtual ~TConcurrentSendSentry();

void commit();

Expand All @@ -48,7 +48,7 @@ class TConcurrentSendSentry {
class TConcurrentRecvSentry {
public:
TConcurrentRecvSentry(TConcurrentClientSyncInfo* sync, int32_t seqid);
~TConcurrentRecvSentry();
virtual ~TConcurrentRecvSentry();

void commit();

Expand Down
2 changes: 1 addition & 1 deletion lib/cpp/src/thrift/async/TEvhttpServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TEvhttpServer {
*/
TEvhttpServer(std::shared_ptr<TAsyncBufferProcessor> processor, int port);

~TEvhttpServer();
virtual ~TEvhttpServer();

static void request(struct evhttp_request* req, void* self);
int serve();
Expand Down
2 changes: 1 addition & 1 deletion lib/cpp/src/thrift/transport/TFileTransport.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ typedef struct readState {
class TFileTransportBuffer {
public:
TFileTransportBuffer(uint32_t size);
~TFileTransportBuffer();
virtual ~TFileTransportBuffer();

bool addEvent(eventInfo* event);
eventInfo* getNext();
Expand Down
4 changes: 2 additions & 2 deletions lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class TOverlappedSubmissionThread : apache::thrift::TNonCopyable {
// thread details
private:
TOverlappedSubmissionThread();
~TOverlappedSubmissionThread();
virtual ~TOverlappedSubmissionThread();
void run();
static unsigned __stdcall thread_proc(void* addr);

Expand All @@ -122,7 +122,7 @@ class TAutoOverlapThread : apache::thrift::TNonCopyable {

public:
TAutoOverlapThread() : p(TOverlappedSubmissionThread::acquire_instance()) {}
~TAutoOverlapThread() { TOverlappedSubmissionThread::release_instance(); }
virtual ~TAutoOverlapThread() { TOverlappedSubmissionThread::release_instance(); }
TOverlappedSubmissionThread* operator->() { return p; }
};
}
Expand Down
8 changes: 4 additions & 4 deletions lib/cpp/src/thrift/windows/Sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace thrift {
struct TCriticalSection : apache::thrift::TNonCopyable {
CRITICAL_SECTION cs;
TCriticalSection() { InitializeCriticalSection(&cs); }
~TCriticalSection() { DeleteCriticalSection(&cs); }
virtual ~TCriticalSection() { DeleteCriticalSection(&cs); }
};

class TAutoCrit : apache::thrift::TNonCopyable {
Expand All @@ -67,7 +67,7 @@ class TAutoCrit : apache::thrift::TNonCopyable {

public:
explicit TAutoCrit(TCriticalSection& cs) : cs_(&cs.cs) { EnterCriticalSection(cs_); }
~TAutoCrit() { LeaveCriticalSection(cs_); }
virtual ~TAutoCrit() { LeaveCriticalSection(cs_); }
};

struct TAutoResetEvent : apache::thrift::TNonCopyable {
Expand All @@ -80,7 +80,7 @@ struct TAutoResetEvent : apache::thrift::TNonCopyable {
throw apache::thrift::concurrency::SystemResourceException("CreateEvent failed");
}
}
~TAutoResetEvent() { CloseHandle(h); }
virtual ~TAutoResetEvent() { CloseHandle(h); }
};

struct TManualResetEvent : apache::thrift::TNonCopyable {
Expand All @@ -93,7 +93,7 @@ struct TManualResetEvent : apache::thrift::TNonCopyable {
throw apache::thrift::concurrency::SystemResourceException("CreateEvent failed");
}
}
~TManualResetEvent() { CloseHandle(h); }
virtual ~TManualResetEvent() { CloseHandle(h); }
};

struct TAutoHandle : apache::thrift::TNonCopyable {
Expand Down
2 changes: 1 addition & 1 deletion lib/cpp/src/thrift/windows/TWinsockSingleton.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class TWinsockSingleton : private apache::thrift::TNonCopyable {
TWinsockSingleton(void);

public:
~TWinsockSingleton(void);
virtual ~TWinsockSingleton(void);

public:
static void create(void);
Expand Down

0 comments on commit db37125

Please sign in to comment.