mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
fix connection pool crash without qapplication (fixes #13166)
This commit is contained in:
parent
93e2c5a01d
commit
f528cb80df
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user