Skip to content

Commit f528cb8

Browse files
committedJul 28, 2015
fix connection pool crash without qapplication (fixes #13166)
1 parent 93e2c5a commit f528cb8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/core/qgsconnectionpool.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#define CONN_POOL_EXPIRATION_TIME 60 // in seconds
3232

3333

34-
/*! Template that stores data related to one server.
34+
/** Template that stores data related to one server.
3535
*
3636
* It is assumed that following functions exist:
3737
* - void qgsConnectionPool_ConnectionCreate(QString name, T& c) ... create a new connection
@@ -164,7 +164,8 @@ class QgsConnectionPoolGroup
164164
QObject::connect( expirationTimer, SIGNAL( timeout() ), parent, SLOT( handleConnectionExpired() ) );
165165

166166
// just to make sure the object belongs to main thread and thus will get events
167-
parent->moveToThread( qApp->thread() );
167+
if ( qApp )
168+
parent->moveToThread( qApp->thread() );
168169
}
169170

170171
void onConnectionExpired()

0 commit comments

Comments
 (0)
Please sign in to comment.