fix connection pool crash without qapplication (fixes #13166)

This commit is contained in:
Juergen E. Fischer 2015-07-28 17:39:22 +02:00
parent 93e2c5a01d
commit f528cb80df

View File

@ -31,7 +31,7 @@
#define CONN_POOL_EXPIRATION_TIME 60 // in seconds
/*! Template that stores data related to one server.
/** Template that stores data related to one server.
*
* It is assumed that following functions exist:
* - void qgsConnectionPool_ConnectionCreate(QString name, T& c) ... create a new connection
@ -164,7 +164,8 @@ class QgsConnectionPoolGroup
QObject::connect( expirationTimer, SIGNAL( timeout() ), parent, SLOT( handleConnectionExpired() ) );
// just to make sure the object belongs to main thread and thus will get events
parent->moveToThread( qApp->thread() );
if ( qApp )
parent->moveToThread( qApp->thread() );
}
void onConnectionExpired()