Skip to content
Permalink
Browse files

[oracle] Fix potential crash on exit

  • Loading branch information
nyalldawson committed Jul 12, 2016
1 parent aaa654f commit 2ccc7e12910689231cc625700f422fd4e33b788f
@@ -16,11 +16,19 @@
#include "qgsoracleconnpool.h"
#include "qgsoracleconn.h"

QgsOracleConnPool QgsOracleConnPool::sInstance;
QgsOracleConnPool* QgsOracleConnPool::sInstance = nullptr;

QgsOracleConnPool* QgsOracleConnPool::instance()
{
return &sInstance;
if ( !sInstance )
sInstance = new QgsOracleConnPool();
return sInstance;
}

void QgsOracleConnPool::cleanupInstance()
{
delete sInstance;
sInstance = nullptr;
}

QgsOracleConnPool::QgsOracleConnPool() : QgsConnectionPool<QgsOracleConn*, QgsOracleConnPoolGroup>()
@@ -70,14 +70,16 @@ class QgsOracleConnPool : public QgsConnectionPool<QgsOracleConn*, QgsOracleConn
public:
static QgsOracleConnPool* instance();

static void cleanupInstance();

protected:
Q_DISABLE_COPY( QgsOracleConnPool )

private:
QgsOracleConnPool();
~QgsOracleConnPool();

static QgsOracleConnPool sInstance;
static QgsOracleConnPool* sInstance;
};


@@ -3177,6 +3177,11 @@ QGISEXTERN bool deleteLayer( const QString& uri, QString& errCause )
return true;
}

QGISEXTERN void cleanupProvider()
{
QgsOracleConnPool::cleanupInstance();
}

// ----------


0 comments on commit 2ccc7e1

Please sign in to comment.
You can’t perform that action at this time.