#538 more dtor fixes and some style fixes along the way

This commit is contained in:
Günter Obiltschnig 2014-09-29 12:09:01 +02:00
parent 135c10c0f5
commit a2617235fe
10 changed files with 68 additions and 37 deletions

View File

@ -51,23 +51,23 @@ void Binder::freeMemory()
{
LengthVec::iterator itLen = _lengthIndicator.begin();
LengthVec::iterator itLenEnd = _lengthIndicator.end();
for(; itLen != itLenEnd; ++itLen) delete *itLen;
for (; itLen != itLenEnd; ++itLen) delete *itLen;
TimeMap::iterator itT = _times.begin();
TimeMap::iterator itTEnd = _times.end();
for(; itT != itTEnd; ++itT) delete itT->first;
for (; itT != itTEnd; ++itT) delete itT->first;
DateMap::iterator itD = _dates.begin();
DateMap::iterator itDEnd = _dates.end();
for(; itD != itDEnd; ++itD) delete itD->first;
for (; itD != itDEnd; ++itD) delete itD->first;
TimestampMap::iterator itTS = _timestamps.begin();
TimestampMap::iterator itTSEnd = _timestamps.end();
for(; itTS != itTSEnd; ++itTS) delete itTS->first;
for (; itTS != itTSEnd; ++itTS) delete itTS->first;
StringMap::iterator itStr = _strings.begin();
StringMap::iterator itStrEnd = _strings.end();
for(; itStr != itStrEnd; ++itStr) std::free(itStr->first);
for (; itStr != itStrEnd; ++itStr) std::free(itStr->first);
CharPtrVec::iterator itChr = _charPtrs.begin();
CharPtrVec::iterator endChr = _charPtrs.end();

View File

@ -64,11 +64,11 @@ ODBCStatementImpl::~ODBCStatementImpl()
{
ColumnPtrVecVec::iterator it = _columnPtrs.begin();
ColumnPtrVecVec::iterator end = _columnPtrs.end();
for(; it != end; ++it)
for (; it != end; ++it)
{
ColumnPtrVec::iterator itC = it->begin();
ColumnPtrVec::iterator endC = it->end();
for(; itC != endC; ++itC) delete *itC;
for (; itC != endC; ++itC) delete *itC;
}
}

View File

@ -140,7 +140,7 @@ public:
}
~CopyBinding()
/// Destroys the Binding.
/// Destroys the CopyBinding.
{
}
@ -264,7 +264,7 @@ public:
}
~CopyBinding()
/// Destroys the Binding.
/// Destroys the CopyBinding.
{
}
@ -396,7 +396,7 @@ public:
}
~CopyBinding()
/// Destroys the Binding.
/// Destroys the CopyBinding.
{
}
@ -559,7 +559,7 @@ public:
}
~CopyBinding()
/// Destroys the Binding.
/// Destroys the CopyBinding.
{
}
@ -689,7 +689,7 @@ public:
}
~CopyBinding()
/// Destroys the Binding.
/// Destroys the CopyBinding.
{
}
@ -819,7 +819,7 @@ public:
}
~CopyBinding()
/// Destroys the Binding.
/// Destroys the CopyBinding.
{
}
@ -949,7 +949,7 @@ public:
}
~CopyBinding()
/// Destroys the Binding.
/// Destroys the CopyBinding.
{
}
@ -1079,7 +1079,7 @@ public:
}
~CopyBinding()
/// Destroys the Binding.
/// Destroys the CopyBinding.
{
}
@ -1209,7 +1209,7 @@ public:
}
~CopyBinding()
/// Destroys the Binding.
/// Destroys the CopyBinding.
{
}
@ -1339,7 +1339,7 @@ public:
}
~CopyBinding()
/// Destroys the Binding.
/// Destroys the CopyBinding.
{
}

View File

@ -86,7 +86,8 @@ Poco::Dynamic::Var& Row::get(std::size_t col)
try
{
return _values.at(col);
}catch (std::out_of_range& re)
}
catch (std::out_of_range& re)
{
throw RangeException(re.what());
}

View File

@ -41,7 +41,14 @@ public:
}
inline ~ScopedUnlock()
{
_mutex.lock();
try
{
_mutex.lock();
}
catch (...)
{
poco_unexpected();
}
}
private:

View File

@ -62,6 +62,7 @@ SortedDirectoryIterator::~SortedDirectoryIterator()
{
}
SortedDirectoryIterator& SortedDirectoryIterator::operator ++()
{
if (!_is_finished)

View File

@ -29,7 +29,14 @@ SplitterChannel::SplitterChannel()
SplitterChannel::~SplitterChannel()
{
close();
try
{
close();
}
catch (...)
{
poco_unexpected();
}
}

View File

@ -39,7 +39,14 @@ Cursor::Cursor(const std::string& fullCollectionName, QueryRequest::Flags flags)
Cursor::~Cursor()
{
poco_assert_dbg(!_response.cursorID());
try
{
poco_assert_dbg(!_response.cursorID());
}
catch (...)
{
}
}

View File

@ -64,28 +64,33 @@ FTPClientSession::FTPClientSession(const std::string& host,
Poco::UInt16 port,
const std::string& username,
const std::string& password):
_host(host),
_port(port),
_pControlSocket(new DialogSocket(SocketAddress(host, port))),
_pDataStream(0),
_passiveMode(true),
_fileType(TYPE_BINARY),
_supports1738(true),
_serverReady(false),
_isLoggedIn(false),
_timeout(DEFAULT_TIMEOUT)
{
_host(host),
_port(port),
_pControlSocket(new DialogSocket(SocketAddress(host, port))),
_pDataStream(0),
_passiveMode(true),
_fileType(TYPE_BINARY),
_supports1738(true),
_serverReady(false),
_isLoggedIn(false),
_timeout(DEFAULT_TIMEOUT)
{
if (!username.empty())
login(username, password);
else
_pControlSocket->setReceiveTimeout(_timeout);
}
}
FTPClientSession::~FTPClientSession()
{
try
{
try { close(); }
catch (...) { }
close();
}
catch (...)
{
}
}
@ -126,7 +131,9 @@ void FTPClientSession::open(const std::string& host,
_host = host;
_port = port;
if (!username.empty())
{
login(username, password);
}
else
{
_pControlSocket = new DialogSocket(SocketAddress(_host, _port));
@ -168,12 +175,12 @@ void FTPClientSession::login(const std::string& username, const std::string& pas
void FTPClientSession::logout()
{
{
if (!isOpen())
throw FTPException("Connection is closed.");
if (_isLoggedIn)
{
{
try { endTransfer(); }
catch (...) { }
std::string response;

View File

@ -66,6 +66,7 @@ SecureSocketImpl::~SecureSocketImpl()
}
catch (...)
{
poco_unexpected();
}
}