Skip to content

Commit

Permalink
fix connection pool crash without qapplication (fixes #13166)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 28, 2015
1 parent 93e2c5a commit f528cb8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/qgsconnectionpool.h
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit f528cb8

Please sign in to comment.