-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Application termination: fix crash caused by 5288aed when layers are …
…still opened at exit
- Loading branch information
Showing
4 changed files
with
20 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,11 +45,19 @@ typedef QString protocolDrivers_t(); | |
//typedef int dataCapabilities_t(); | ||
//typedef QgsDataItem * dataItem_t(QString); | ||
|
||
|
||
static QMutex mutex; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rouault
Author
Contributor
|
||
static QgsProviderRegistry *sInstance = nullptr; | ||
|
||
QgsProviderRegistry *QgsProviderRegistry::instance( const QString &pluginPath ) | ||
{ | ||
static QgsProviderRegistry *sInstance( new QgsProviderRegistry( pluginPath ) ); | ||
if ( !sInstance ) | ||
{ | ||
QMutexLocker locker( &mutex ); | ||
if ( !sInstance ) | ||
{ | ||
sInstance = new QgsProviderRegistry( pluginPath ); | ||
} | ||
} | ||
return sInstance; | ||
} // QgsProviderRegistry::instance | ||
|
||
|
@@ -256,6 +264,8 @@ void QgsProviderRegistry::clean() | |
QgsProviderRegistry::~QgsProviderRegistry() | ||
{ | ||
clean(); | ||
if ( sInstance == this ) | ||
sInstance = nullptr; | ||
} | ||
|
||
|
||
|
just curious: why did you make this static? It does not need to be, correct?