diff --git a/src/main/cpp/filewatchdog.cpp b/src/main/cpp/filewatchdog.cpp index ef9f80cde..903d93080 100644 --- a/src/main/cpp/filewatchdog.cpp +++ b/src/main/cpp/filewatchdog.cpp @@ -41,7 +41,11 @@ struct FileWatchdog::FileWatchdogPrivate{ #if LOG4CXX_EVENTS_AT_EXIT , atExitRegistryRaii([this]{stopWatcher();}) #endif + { } + + ~FileWatchdogPrivate() { stopWatcher(); } + /** The name of the file to observe for changes. */ diff --git a/src/main/cpp/telnetappender.cpp b/src/main/cpp/telnetappender.cpp index 204aba305..d012f66ff 100644 --- a/src/main/cpp/telnetappender.cpp +++ b/src/main/cpp/telnetappender.cpp @@ -52,7 +52,10 @@ struct TelnetAppender::TelnetAppenderPriv : public AppenderSkeletonPrivate #if LOG4CXX_EVENTS_AT_EXIT , atExitRegistryRaii([this]{stopAcceptingConnections();}) #endif - { stopAcceptingConnections(); } + { } + + ~TelnetAppenderPriv() + { stopAcceptingConnections(); } int port; ConnectionList connections; diff --git a/src/main/include/log4cxx/private/socketappenderskeleton_priv.h b/src/main/include/log4cxx/private/socketappenderskeleton_priv.h index 9519db1a1..64ef6c35a 100644 --- a/src/main/include/log4cxx/private/socketappenderskeleton_priv.h +++ b/src/main/include/log4cxx/private/socketappenderskeleton_priv.h @@ -42,7 +42,7 @@ struct SocketAppenderSkeleton::SocketAppenderSkeletonPriv : public AppenderSkele #if LOG4CXX_EVENTS_AT_EXIT , atExitRegistryRaii([this]{stopMonitor();}) #endif - { stopMonitor(); } + { } SocketAppenderSkeletonPriv(helpers::InetAddressPtr address, int defaultPort, int reconnectionDelay) : AppenderSkeletonPrivate(), @@ -54,7 +54,7 @@ struct SocketAppenderSkeleton::SocketAppenderSkeletonPriv : public AppenderSkele #if LOG4CXX_EVENTS_AT_EXIT , atExitRegistryRaii([this]{stopMonitor();}) #endif - { stopMonitor(); } + { } SocketAppenderSkeletonPriv(const LogString& host, int port, int delay) : AppenderSkeletonPrivate(), @@ -66,6 +66,9 @@ struct SocketAppenderSkeleton::SocketAppenderSkeletonPriv : public AppenderSkele #if LOG4CXX_EVENTS_AT_EXIT , atExitRegistryRaii([this]{stopMonitor();}) #endif + { } + + ~SocketAppenderSkeletonPriv() { stopMonitor(); } /**