mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-01 09:24:55 +02:00
#538 prevent destructors from throwing exceptions
This commit is contained in:
parent
c8686a727d
commit
544229302e
@ -46,9 +46,16 @@ OpenSSLInitializer::OpenSSLInitializer()
|
|||||||
|
|
||||||
|
|
||||||
OpenSSLInitializer::~OpenSSLInitializer()
|
OpenSSLInitializer::~OpenSSLInitializer()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
uninitialize();
|
uninitialize();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void OpenSSLInitializer::initialize()
|
void OpenSSLInitializer::initialize()
|
||||||
|
@ -32,9 +32,16 @@ PooledSessionImpl::PooledSessionImpl(PooledSessionHolder* pHolder):
|
|||||||
|
|
||||||
|
|
||||||
PooledSessionImpl::~PooledSessionImpl()
|
PooledSessionImpl::~PooledSessionImpl()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
StatementImpl* PooledSessionImpl::createStatementImpl()
|
StatementImpl* PooledSessionImpl::createStatementImpl()
|
||||||
|
@ -74,6 +74,8 @@ RecordSet::RecordSet(const RecordSet& other):
|
|||||||
|
|
||||||
|
|
||||||
RecordSet::~RecordSet()
|
RecordSet::~RecordSet()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
delete _pBegin;
|
delete _pBegin;
|
||||||
delete _pEnd;
|
delete _pEnd;
|
||||||
@ -83,6 +85,11 @@ RecordSet::~RecordSet()
|
|||||||
RowMap::iterator end = _rowMap.end();
|
RowMap::iterator end = _rowMap.end();
|
||||||
for (; it != end; ++it) delete it->second;
|
for (; it != end; ++it) delete it->second;
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Poco::Dynamic::Var RecordSet::value(std::size_t col, std::size_t row, bool useFilter) const
|
Poco::Dynamic::Var RecordSet::value(std::size_t col, std::size_t row, bool useFilter) const
|
||||||
|
@ -59,11 +59,18 @@ void RowFilter::init()
|
|||||||
|
|
||||||
|
|
||||||
RowFilter::~RowFilter()
|
RowFilter::~RowFilter()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
release();
|
release();
|
||||||
if (_pRecordSet) _pRecordSet->filter(0);
|
if (_pRecordSet) _pRecordSet->filter(0);
|
||||||
if (_pParent.get()) _pParent->removeFilter(this);
|
if (_pParent.get()) _pParent->removeFilter(this);
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool RowFilter::isAllowed(std::size_t row) const
|
bool RowFilter::isAllowed(std::size_t row) const
|
||||||
|
@ -68,9 +68,16 @@ SQLChannel::SQLChannel(const std::string& connector,
|
|||||||
|
|
||||||
|
|
||||||
SQLChannel::~SQLChannel()
|
SQLChannel::~SQLChannel()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SQLChannel::open()
|
void SQLChannel::open()
|
||||||
|
@ -40,9 +40,16 @@ SessionPool::SessionPool(const std::string& connector, const std::string& connec
|
|||||||
|
|
||||||
|
|
||||||
SessionPool::~SessionPool()
|
SessionPool::~SessionPool()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
shutdown();
|
shutdown();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Session SessionPool::get(const std::string& name, bool value)
|
Session SessionPool::get(const std::string& name, bool value)
|
||||||
|
@ -39,6 +39,8 @@ Transaction::Transaction(Poco::Data::Session& rSession, bool start):
|
|||||||
|
|
||||||
|
|
||||||
Transaction::~Transaction()
|
Transaction::~Transaction()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (_rSession.isTransaction())
|
if (_rSession.isTransaction())
|
||||||
{
|
{
|
||||||
@ -56,6 +58,11 @@ Transaction::~Transaction()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Transaction::begin()
|
void Transaction::begin()
|
||||||
|
@ -63,9 +63,16 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual ~AbstractCache()
|
virtual ~AbstractCache()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
uninitialize();
|
uninitialize();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void add(const TKey& key, const TValue& val)
|
void add(const TKey& key, const TValue& val)
|
||||||
/// Adds the key value pair to the cache.
|
/// Adds the key value pair to the cache.
|
||||||
|
@ -93,10 +93,17 @@ public:
|
|||||||
|
|
||||||
~Activity()
|
~Activity()
|
||||||
/// Stops and destroys the activity.
|
/// Stops and destroys the activity.
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
stop();
|
stop();
|
||||||
wait();
|
wait();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void start()
|
void start()
|
||||||
/// Starts the activity by acquiring a
|
/// Starts the activity by acquiring a
|
||||||
|
@ -58,7 +58,6 @@ union Placeholder
|
|||||||
/// where the object was allocated (0 => heap, 1 => local).
|
/// where the object was allocated (0 => heap, 1 => local).
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
struct Size
|
struct Size
|
||||||
{
|
{
|
||||||
static const unsigned int value = SizeV;
|
static const unsigned int value = SizeV;
|
||||||
|
@ -186,9 +186,16 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
~BasicMemoryBinaryWriter()
|
~BasicMemoryBinaryWriter()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
flush();
|
flush();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Buffer<T>& data()
|
Buffer<T>& data()
|
||||||
{
|
{
|
||||||
|
@ -41,7 +41,7 @@ public:
|
|||||||
return new char_type[static_cast<std::size_t>(size)];
|
return new char_type[static_cast<std::size_t>(size)];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deallocate(char_type* ptr, std::streamsize /*size*/)
|
static void deallocate(char_type* ptr, std::streamsize /*size*/) throw()
|
||||||
{
|
{
|
||||||
delete [] ptr;
|
delete [] ptr;
|
||||||
}
|
}
|
||||||
|
@ -150,9 +150,16 @@ inline NDCScope::NDCScope(const std::string& info, int line, const char* filenam
|
|||||||
|
|
||||||
|
|
||||||
inline NDCScope::~NDCScope()
|
inline NDCScope::~NDCScope()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
NestedDiagnosticContext::current().pop();
|
NestedDiagnosticContext::current().pop();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -193,12 +193,19 @@ public:
|
|||||||
|
|
||||||
~ObjectPool()
|
~ObjectPool()
|
||||||
/// Destroys the ObjectPool.
|
/// Destroys the ObjectPool.
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
for (typename std::vector<P>::iterator it = _pool.begin(); it != _pool.end(); ++it)
|
for (typename std::vector<P>::iterator it = _pool.begin(); it != _pool.end(); ++it)
|
||||||
{
|
{
|
||||||
_factory.destroyObject(*it);
|
_factory.destroyObject(*it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
P borrowObject()
|
P borrowObject()
|
||||||
/// Obtains an object from the pool, or creates a new object if
|
/// Obtains an object from the pool, or creates a new object if
|
||||||
|
@ -167,9 +167,16 @@ inline ScopedRWLock::ScopedRWLock(RWLock& rwl, bool write): _rwl(rwl)
|
|||||||
|
|
||||||
|
|
||||||
inline ScopedRWLock::~ScopedRWLock()
|
inline ScopedRWLock::~ScopedRWLock()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_rwl.unlock();
|
_rwl.unlock();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline ScopedReadRWLock::ScopedReadRWLock(RWLock& rwl): ScopedRWLock(rwl, false)
|
inline ScopedReadRWLock::ScopedReadRWLock(RWLock& rwl): ScopedRWLock(rwl, false)
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
void duplicate() const;
|
void duplicate() const;
|
||||||
/// Increments the object's reference count.
|
/// Increments the object's reference count.
|
||||||
|
|
||||||
void release() const;
|
void release() const throw();
|
||||||
/// Decrements the object's reference count
|
/// Decrements the object's reference count
|
||||||
/// and deletes the object if the count
|
/// and deletes the object if the count
|
||||||
/// reaches zero.
|
/// reaches zero.
|
||||||
@ -77,10 +77,17 @@ inline void RefCountedObject::duplicate() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void RefCountedObject::release() const
|
inline void RefCountedObject::release() const throw()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (--_counter == 0) delete this;
|
if (--_counter == 0) delete this;
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace Poco
|
} // namespace Poco
|
||||||
|
@ -46,9 +46,16 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
~ScopedLock()
|
~ScopedLock()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_mutex.unlock();
|
_mutex.unlock();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
M& _mutex;
|
M& _mutex;
|
||||||
@ -81,9 +88,16 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
~ScopedLockWithUnlock()
|
~ScopedLockWithUnlock()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
unlock();
|
unlock();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void unlock()
|
void unlock()
|
||||||
{
|
{
|
||||||
|
@ -142,9 +142,16 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
~SharedPtr()
|
~SharedPtr()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
release();
|
release();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SharedPtr& assign(C* ptr)
|
SharedPtr& assign(C* ptr)
|
||||||
{
|
{
|
||||||
|
@ -58,10 +58,17 @@ AsyncChannel::AsyncChannel(Channel* pChannel, Thread::Priority prio):
|
|||||||
|
|
||||||
|
|
||||||
AsyncChannel::~AsyncChannel()
|
AsyncChannel::~AsyncChannel()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
if (_pChannel) _pChannel->release();
|
if (_pChannel) _pChannel->release();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AsyncChannel::setChannel(Channel* pChannel)
|
void AsyncChannel::setChannel(Channel* pChannel)
|
||||||
|
@ -540,10 +540,17 @@ DirectoryWatcher::DirectoryWatcher(const Poco::File& directory, int eventMask, i
|
|||||||
|
|
||||||
|
|
||||||
DirectoryWatcher::~DirectoryWatcher()
|
DirectoryWatcher::~DirectoryWatcher()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
stop();
|
stop();
|
||||||
delete _pStrategy;
|
delete _pStrategy;
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void DirectoryWatcher::suspendEvents()
|
void DirectoryWatcher::suspendEvents()
|
||||||
|
@ -80,9 +80,16 @@ EventLogChannel::EventLogChannel(const std::string& name, const std::string& hos
|
|||||||
|
|
||||||
|
|
||||||
EventLogChannel::~EventLogChannel()
|
EventLogChannel::~EventLogChannel()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void EventLogChannel::open()
|
void EventLogChannel::open()
|
||||||
|
@ -70,12 +70,19 @@ FileChannel::FileChannel(const std::string& path):
|
|||||||
|
|
||||||
|
|
||||||
FileChannel::~FileChannel()
|
FileChannel::~FileChannel()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
delete _pRotateStrategy;
|
delete _pRotateStrategy;
|
||||||
delete _pArchiveStrategy;
|
delete _pArchiveStrategy;
|
||||||
delete _pPurgeStrategy;
|
delete _pPurgeStrategy;
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void FileChannel::open()
|
void FileChannel::open()
|
||||||
|
@ -443,9 +443,16 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
~AutoLoggerShutdown()
|
~AutoLoggerShutdown()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Logger::shutdown();
|
Logger::shutdown();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,9 +29,16 @@ NotificationQueue::NotificationQueue()
|
|||||||
|
|
||||||
|
|
||||||
NotificationQueue::~NotificationQueue()
|
NotificationQueue::~NotificationQueue()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void NotificationQueue::enqueueNotification(Notification::Ptr pNotification)
|
void NotificationQueue::enqueueNotification(Notification::Ptr pNotification)
|
||||||
|
@ -29,9 +29,16 @@ PriorityNotificationQueue::PriorityNotificationQueue()
|
|||||||
|
|
||||||
|
|
||||||
PriorityNotificationQueue::~PriorityNotificationQueue()
|
PriorityNotificationQueue::~PriorityNotificationQueue()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void PriorityNotificationQueue::enqueueNotification(Notification::Ptr pNotification, int priority)
|
void PriorityNotificationQueue::enqueueNotification(Notification::Ptr pNotification, int priority)
|
||||||
|
@ -51,9 +51,16 @@ SimpleFileChannel::SimpleFileChannel(const std::string& path):
|
|||||||
|
|
||||||
|
|
||||||
SimpleFileChannel::~SimpleFileChannel()
|
SimpleFileChannel::~SimpleFileChannel()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SimpleFileChannel::open()
|
void SimpleFileChannel::open()
|
||||||
|
@ -36,6 +36,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
~TempFileCollector()
|
~TempFileCollector()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
for (std::set<std::string>::iterator it = _files.begin(); it != _files.end(); ++it)
|
for (std::set<std::string>::iterator it = _files.begin(); it != _files.end(); ++it)
|
||||||
{
|
{
|
||||||
@ -50,6 +52,11 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void registerFile(const std::string& path)
|
void registerFile(const std::string& path)
|
||||||
{
|
{
|
||||||
@ -80,6 +87,8 @@ TemporaryFile::TemporaryFile(const std::string& tempDir):
|
|||||||
|
|
||||||
|
|
||||||
TemporaryFile::~TemporaryFile()
|
TemporaryFile::~TemporaryFile()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (!_keep)
|
if (!_keep)
|
||||||
{
|
{
|
||||||
@ -93,6 +102,11 @@ TemporaryFile::~TemporaryFile()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void TemporaryFile::keep()
|
void TemporaryFile::keep()
|
||||||
|
@ -279,9 +279,16 @@ ThreadPool::ThreadPool(const std::string& name,
|
|||||||
|
|
||||||
|
|
||||||
ThreadPool::~ThreadPool()
|
ThreadPool::~ThreadPool()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
stopAll();
|
stopAll();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ThreadPool::addCapacity(int n)
|
void ThreadPool::addCapacity(int n)
|
||||||
|
@ -28,9 +28,16 @@ TimedNotificationQueue::TimedNotificationQueue()
|
|||||||
|
|
||||||
|
|
||||||
TimedNotificationQueue::~TimedNotificationQueue()
|
TimedNotificationQueue::~TimedNotificationQueue()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void TimedNotificationQueue::enqueueNotification(Notification::Ptr pNotification, Timestamp timestamp)
|
void TimedNotificationQueue::enqueueNotification(Notification::Ptr pNotification, Timestamp timestamp)
|
||||||
|
@ -34,9 +34,16 @@ Timer::Timer(long startInterval, long periodicInterval):
|
|||||||
|
|
||||||
|
|
||||||
Timer::~Timer()
|
Timer::~Timer()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Timer::start(const AbstractTimerCallback& method)
|
void Timer::start(const AbstractTimerCallback& method)
|
||||||
|
@ -83,9 +83,16 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual ~PooledConnection()
|
virtual ~PooledConnection()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_pool.returnObject(_connection);
|
_pool.returnObject(_connection);
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
operator Connection::Ptr ()
|
operator Connection::Ptr ()
|
||||||
{
|
{
|
||||||
|
@ -86,9 +86,16 @@ public:
|
|||||||
|
|
||||||
virtual ~ParallelSocketAcceptor()
|
virtual ~ParallelSocketAcceptor()
|
||||||
/// Destroys the ParallelSocketAcceptor.
|
/// Destroys the ParallelSocketAcceptor.
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
unregisterAcceptor();
|
unregisterAcceptor();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virtual void registerAcceptor(SocketReactor& reactor)
|
virtual void registerAcceptor(SocketReactor& reactor)
|
||||||
/// Registers the ParallelSocketAcceptor with a SocketReactor.
|
/// Registers the ParallelSocketAcceptor with a SocketReactor.
|
||||||
|
@ -87,9 +87,16 @@ public:
|
|||||||
|
|
||||||
virtual ~SocketAcceptor()
|
virtual ~SocketAcceptor()
|
||||||
/// Destroys the SocketAcceptor.
|
/// Destroys the SocketAcceptor.
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
unregisterAcceptor();
|
unregisterAcceptor();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virtual void registerAcceptor(SocketReactor& reactor)
|
virtual void registerAcceptor(SocketReactor& reactor)
|
||||||
/// Registers the SocketAcceptor with a SocketReactor.
|
/// Registers the SocketAcceptor with a SocketReactor.
|
||||||
|
@ -91,9 +91,16 @@ public:
|
|||||||
|
|
||||||
virtual ~SocketConnector()
|
virtual ~SocketConnector()
|
||||||
/// Destroys the SocketConnector.
|
/// Destroys the SocketConnector.
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
unregisterConnector();
|
unregisterConnector();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virtual void registerConnector(SocketReactor& reactor)
|
virtual void registerConnector(SocketReactor& reactor)
|
||||||
/// Registers the SocketConnector with a SocketReactor.
|
/// Registers the SocketConnector with a SocketReactor.
|
||||||
|
@ -160,9 +160,16 @@ void* HTTPChunkedInputStream::operator new(std::size_t size)
|
|||||||
|
|
||||||
|
|
||||||
void HTTPChunkedInputStream::operator delete(void* ptr)
|
void HTTPChunkedInputStream::operator delete(void* ptr)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_pool.release(ptr);
|
_pool.release(ptr);
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -192,9 +199,16 @@ void* HTTPChunkedOutputStream::operator new(std::size_t size)
|
|||||||
|
|
||||||
|
|
||||||
void HTTPChunkedOutputStream::operator delete(void* ptr)
|
void HTTPChunkedOutputStream::operator delete(void* ptr)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_pool.release(ptr);
|
_pool.release(ptr);
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Net
|
} } // namespace Poco::Net
|
||||||
|
@ -129,9 +129,16 @@ void* HTTPFixedLengthInputStream::operator new(std::size_t size)
|
|||||||
|
|
||||||
|
|
||||||
void HTTPFixedLengthInputStream::operator delete(void* ptr)
|
void HTTPFixedLengthInputStream::operator delete(void* ptr)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_pool.release(ptr);
|
_pool.release(ptr);
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -161,9 +168,16 @@ void* HTTPFixedLengthOutputStream::operator new(std::size_t size)
|
|||||||
|
|
||||||
|
|
||||||
void HTTPFixedLengthOutputStream::operator delete(void* ptr)
|
void HTTPFixedLengthOutputStream::operator delete(void* ptr)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_pool.release(ptr);
|
_pool.release(ptr);
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Net
|
} } // namespace Poco::Net
|
||||||
|
@ -126,9 +126,16 @@ void* HTTPHeaderInputStream::operator new(std::size_t size)
|
|||||||
|
|
||||||
|
|
||||||
void HTTPHeaderInputStream::operator delete(void* ptr)
|
void HTTPHeaderInputStream::operator delete(void* ptr)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_pool.release(ptr);
|
_pool.release(ptr);
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -158,9 +165,16 @@ void* HTTPHeaderOutputStream::operator new(std::size_t size)
|
|||||||
|
|
||||||
|
|
||||||
void HTTPHeaderOutputStream::operator delete(void* ptr)
|
void HTTPHeaderOutputStream::operator delete(void* ptr)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_pool.release(ptr);
|
_pool.release(ptr);
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Net
|
} } // namespace Poco::Net
|
||||||
|
@ -44,9 +44,16 @@ HTTPServerConnection::HTTPServerConnection(const StreamSocket& socket, HTTPServe
|
|||||||
|
|
||||||
|
|
||||||
HTTPServerConnection::~HTTPServerConnection()
|
HTTPServerConnection::~HTTPServerConnection()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_pFactory->serverStopped -= Poco::delegate(this, &HTTPServerConnection::onServerStopped);
|
_pFactory->serverStopped -= Poco::delegate(this, &HTTPServerConnection::onServerStopped);
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void HTTPServerConnection::run()
|
void HTTPServerConnection::run()
|
||||||
|
@ -63,6 +63,8 @@ HTTPSession::HTTPSession(const StreamSocket& socket, bool keepAlive):
|
|||||||
|
|
||||||
|
|
||||||
HTTPSession::~HTTPSession()
|
HTTPSession::~HTTPSession()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (_pBuffer) HTTPBufferAllocator::deallocate(_pBuffer, HTTPBufferAllocator::BUFFER_SIZE);
|
if (_pBuffer) HTTPBufferAllocator::deallocate(_pBuffer, HTTPBufferAllocator::BUFFER_SIZE);
|
||||||
try
|
try
|
||||||
@ -74,6 +76,11 @@ HTTPSession::~HTTPSession()
|
|||||||
}
|
}
|
||||||
delete _pException;
|
delete _pException;
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void HTTPSession::setKeepAlive(bool keepAlive)
|
void HTTPSession::setKeepAlive(bool keepAlive)
|
||||||
|
@ -120,9 +120,16 @@ void* HTTPInputStream::operator new(std::size_t size)
|
|||||||
|
|
||||||
|
|
||||||
void HTTPInputStream::operator delete(void* ptr)
|
void HTTPInputStream::operator delete(void* ptr)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_pool.release(ptr);
|
_pool.release(ptr);
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -152,9 +159,16 @@ void* HTTPOutputStream::operator new(std::size_t size)
|
|||||||
|
|
||||||
|
|
||||||
void HTTPOutputStream::operator delete(void* ptr)
|
void HTTPOutputStream::operator delete(void* ptr)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_pool.release(ptr);
|
_pool.release(ptr);
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Net
|
} } // namespace Poco::Net
|
||||||
|
@ -130,9 +130,15 @@ MultipartIOS::MultipartIOS(std::istream& istr, const std::string& boundary):
|
|||||||
|
|
||||||
|
|
||||||
MultipartIOS::~MultipartIOS()
|
MultipartIOS::~MultipartIOS()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_buf.sync();
|
_buf.sync();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MultipartStreamBuf* MultipartIOS::rdbuf()
|
MultipartStreamBuf* MultipartIOS::rdbuf()
|
||||||
|
@ -61,9 +61,16 @@ void Net_API uninitializeNetwork()
|
|||||||
|
|
||||||
~NetworkInitializer()
|
~NetworkInitializer()
|
||||||
/// Calls Poco::Net::uninitializeNetwork();
|
/// Calls Poco::Net::uninitializeNetwork();
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Poco::Net::uninitializeNetwork();
|
Poco::Net::uninitializeNetwork();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const NetworkInitializer pocoNetworkInitializer;
|
const NetworkInitializer pocoNetworkInitializer;
|
||||||
|
@ -24,7 +24,10 @@ namespace Poco {
|
|||||||
namespace Net {
|
namespace Net {
|
||||||
|
|
||||||
|
|
||||||
/// PartStore
|
//
|
||||||
|
// PartStore
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
PartStore::PartStore(const std::string& mediaType): PartSource(mediaType)
|
PartStore::PartStore(const std::string& mediaType): PartSource(mediaType)
|
||||||
{
|
{
|
||||||
@ -36,7 +39,10 @@ PartStore::~PartStore()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// FilePartStore
|
//
|
||||||
|
// FilePartStore
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
FilePartStore::FilePartStore(const std::string& content, const std::string& mediaType, const std::string& filename):
|
FilePartStore::FilePartStore(const std::string& content, const std::string& mediaType, const std::string& filename):
|
||||||
PartStore(mediaType),
|
PartStore(mediaType),
|
||||||
@ -56,7 +62,7 @@ FilePartStore::~FilePartStore()
|
|||||||
_fstr.close();
|
_fstr.close();
|
||||||
File(_path).remove();
|
File(_path).remove();
|
||||||
}
|
}
|
||||||
catch (Exception&)
|
catch (...)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,9 +60,16 @@ RemoteSyslogChannel::RemoteSyslogChannel(const std::string& address, const std::
|
|||||||
|
|
||||||
|
|
||||||
RemoteSyslogChannel::~RemoteSyslogChannel()
|
RemoteSyslogChannel::~RemoteSyslogChannel()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void RemoteSyslogChannel::open()
|
void RemoteSyslogChannel::open()
|
||||||
|
@ -68,9 +68,16 @@ SMTPChannel::SMTPChannel(const std::string& mailhost, const std::string& sender,
|
|||||||
|
|
||||||
|
|
||||||
SMTPChannel::~SMTPChannel()
|
SMTPChannel::~SMTPChannel()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SMTPChannel::open()
|
void SMTPChannel::open()
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include <stropts.h>
|
#include <stropts.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
using Poco::IOException;
|
using Poco::IOException;
|
||||||
using Poco::TimeoutException;
|
using Poco::TimeoutException;
|
||||||
using Poco::InvalidArgumentException;
|
using Poco::InvalidArgumentException;
|
||||||
|
@ -71,10 +71,17 @@ TCPServer::TCPServer(TCPServerConnectionFactory::Ptr pFactory, Poco::ThreadPool&
|
|||||||
|
|
||||||
|
|
||||||
TCPServer::~TCPServer()
|
TCPServer::~TCPServer()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
stop();
|
stop();
|
||||||
_pDispatcher->release();
|
_pDispatcher->release();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const TCPServerParams& TCPServer::params() const
|
const TCPServerParams& TCPServer::params() const
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include "Poco/MemoryStream.h"
|
#include "Poco/MemoryStream.h"
|
||||||
#include "Poco/Format.h"
|
#include "Poco/Format.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
namespace Net {
|
namespace Net {
|
||||||
@ -41,10 +41,17 @@ WebSocketImpl::WebSocketImpl(StreamSocketImpl* pStreamSocketImpl, bool mustMaskP
|
|||||||
|
|
||||||
|
|
||||||
WebSocketImpl::~WebSocketImpl()
|
WebSocketImpl::~WebSocketImpl()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_pStreamSocketImpl->release();
|
_pStreamSocketImpl->release();
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int WebSocketImpl::sendBytes(const void* buffer, int length, int flags)
|
int WebSocketImpl::sendBytes(const void* buffer, int length, int flags)
|
||||||
|
@ -167,11 +167,17 @@ Context::Context(
|
|||||||
|
|
||||||
|
|
||||||
Context::~Context()
|
Context::~Context()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
SSL_CTX_free(_pSSLContext);
|
SSL_CTX_free(_pSSLContext);
|
||||||
|
|
||||||
Poco::Crypto::OpenSSLInitializer::uninitialize();
|
Poco::Crypto::OpenSSLInitializer::uninitialize();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Context::useCertificate(const Poco::Crypto::X509Certificate& certificate)
|
void Context::useCertificate(const Poco::Crypto::X509Certificate& certificate)
|
||||||
|
@ -36,12 +36,19 @@ InvalidCertificateHandler::InvalidCertificateHandler(bool handleErrorsOnServerSi
|
|||||||
|
|
||||||
|
|
||||||
InvalidCertificateHandler::~InvalidCertificateHandler()
|
InvalidCertificateHandler::~InvalidCertificateHandler()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (_handleErrorsOnServerSide)
|
if (_handleErrorsOnServerSide)
|
||||||
SSLManager::instance().ServerVerificationError -= Delegate<InvalidCertificateHandler, VerificationErrorArgs>(this, &InvalidCertificateHandler::onInvalidCertificate);
|
SSLManager::instance().ServerVerificationError -= Delegate<InvalidCertificateHandler, VerificationErrorArgs>(this, &InvalidCertificateHandler::onInvalidCertificate);
|
||||||
else
|
else
|
||||||
SSLManager::instance().ClientVerificationError -= Delegate<InvalidCertificateHandler, VerificationErrorArgs>(this, &InvalidCertificateHandler::onInvalidCertificate);
|
SSLManager::instance().ClientVerificationError -= Delegate<InvalidCertificateHandler, VerificationErrorArgs>(this, &InvalidCertificateHandler::onInvalidCertificate);
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Net
|
} } // namespace Poco::Net
|
||||||
|
@ -33,9 +33,16 @@ PrivateKeyPassphraseHandler::PrivateKeyPassphraseHandler(bool onServerSide): _se
|
|||||||
|
|
||||||
|
|
||||||
PrivateKeyPassphraseHandler::~PrivateKeyPassphraseHandler()
|
PrivateKeyPassphraseHandler::~PrivateKeyPassphraseHandler()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
SSLManager::instance().PrivateKeyPassphraseRequired -= Delegate<PrivateKeyPassphraseHandler, std::string>(this, &PrivateKeyPassphraseHandler::onPrivateKeyRequested);
|
SSLManager::instance().PrivateKeyPassphraseRequired -= Delegate<PrivateKeyPassphraseHandler, std::string>(this, &PrivateKeyPassphraseHandler::onPrivateKeyRequested);
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Net
|
} } // namespace Poco::Net
|
||||||
|
@ -68,9 +68,16 @@ SSLManager::SSLManager()
|
|||||||
|
|
||||||
|
|
||||||
SSLManager::~SSLManager()
|
SSLManager::~SSLManager()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
shutdown();
|
shutdown();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SSLManager::shutdown()
|
void SSLManager::shutdown()
|
||||||
|
@ -28,9 +28,16 @@ SecureServerSocketImpl::SecureServerSocketImpl(Context::Ptr pContext):
|
|||||||
|
|
||||||
|
|
||||||
SecureServerSocketImpl::~SecureServerSocketImpl()
|
SecureServerSocketImpl::~SecureServerSocketImpl()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SocketImpl* SecureServerSocketImpl::acceptConnection(SocketAddress& clientAddr)
|
SocketImpl* SecureServerSocketImpl::acceptConnection(SocketAddress& clientAddr)
|
||||||
|
@ -40,9 +40,16 @@ SecureStreamSocketImpl::SecureStreamSocketImpl(StreamSocketImpl* pStreamSocket,
|
|||||||
|
|
||||||
|
|
||||||
SecureStreamSocketImpl::~SecureStreamSocketImpl()
|
SecureStreamSocketImpl::~SecureStreamSocketImpl()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SocketImpl* SecureStreamSocketImpl::acceptConnection(SocketAddress& clientAddr)
|
SocketImpl* SecureStreamSocketImpl::acceptConnection(SocketAddress& clientAddr)
|
||||||
|
@ -46,9 +46,16 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
~ArchiveImpl()
|
~ArchiveImpl()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const std::string& path() const
|
const std::string& path() const
|
||||||
{
|
{
|
||||||
|
@ -231,10 +231,17 @@ Timer::Timer(Poco::Thread::Priority priority)
|
|||||||
|
|
||||||
|
|
||||||
Timer::~Timer()
|
Timer::~Timer()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_queue.enqueueNotification(new StopNotification(_queue), Poco::Clock(0));
|
_queue.enqueueNotification(new StopNotification(_queue), Poco::Clock(0));
|
||||||
_thread.join();
|
_thread.join();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Timer::cancel(bool wait)
|
void Timer::cancel(bool wait)
|
||||||
|
@ -53,9 +53,16 @@ Decompress::Decompress(std::istream& in, const Poco::Path& outputDir, bool flatt
|
|||||||
|
|
||||||
|
|
||||||
Decompress::~Decompress()
|
Decompress::~Decompress()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
EOk -= Poco::Delegate<Decompress, std::pair<const ZipLocalFileHeader, const Poco::Path> >(this, &Decompress::onOk);
|
EOk -= Poco::Delegate<Decompress, std::pair<const ZipLocalFileHeader, const Poco::Path> >(this, &Decompress::onOk);
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ZipArchive Decompress::decompressAllFiles()
|
ZipArchive Decompress::decompressAllFiles()
|
||||||
|
@ -241,9 +241,16 @@ PartialOutputStream::PartialOutputStream(std::ostream& ostr, std::size_t start,
|
|||||||
|
|
||||||
|
|
||||||
PartialOutputStream::~PartialOutputStream()
|
PartialOutputStream::~PartialOutputStream()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
poco_unexpected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Zip
|
} } // namespace Poco::Zip
|
||||||
|
Loading…
x
Reference in New Issue
Block a user