mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 17:30:44 +02:00
eliminate some gcc warnings, move register/unregister to be called only once
This commit is contained in:
@@ -71,15 +71,16 @@ ODBCSQLServerTest::ODBCSQLServerTest(const std::string& name):
|
||||
{
|
||||
static bool beenHere = false;
|
||||
|
||||
ODBC::Connector::registerConnector();
|
||||
if (_drivers.empty() || _dataSources.empty())
|
||||
{
|
||||
Utility::drivers(_drivers);
|
||||
Utility::dataSources(_dataSources);
|
||||
checkODBCSetup();
|
||||
}
|
||||
|
||||
if (!_pSession && !_dbConnString.empty() && !beenHere)
|
||||
{
|
||||
ODBC::Connector::registerConnector();
|
||||
try
|
||||
{
|
||||
_pSession = new Session(SessionFactory::instance().create(ODBC::Connector::KEY, _dbConnString));
|
||||
@@ -91,7 +92,9 @@ ODBCSQLServerTest::ODBCSQLServerTest(const std::string& name):
|
||||
|
||||
if (_pSession && _pSession->isConnected())
|
||||
std::cout << "*** Connected to " << _dsn << '(' << _dbConnString << ')' << std::endl;
|
||||
if (!_pExecutor) _pExecutor = new SQLExecutor("SQLServer SQL Executor", _pSession);
|
||||
if (!_pExecutor)
|
||||
_pExecutor = new SQLExecutor("SQLServer SQL Executor", _pSession);
|
||||
|
||||
}
|
||||
else
|
||||
if (!_pSession && !beenHere)
|
||||
@@ -103,7 +106,6 @@ ODBCSQLServerTest::ODBCSQLServerTest(const std::string& name):
|
||||
|
||||
ODBCSQLServerTest::~ODBCSQLServerTest()
|
||||
{
|
||||
ODBC::Connector::unregisterConnector();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user