Skip to content

Commit

Permalink
use static locals instead of global pointers for some singletons
Browse files Browse the repository at this point in the history
(proably more valgrind happyness; followup 572bda8)
  • Loading branch information
m-kuhn committed Oct 17, 2013
1 parent cca5805 commit 60b90c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 2 additions & 7 deletions src/core/qgsnetworkaccessmanager.cpp
Expand Up @@ -72,16 +72,11 @@ class QgsNetworkProxyFactory : public QNetworkProxyFactory
};
#endif

QgsNetworkAccessManager *QgsNetworkAccessManager::smNAM = 0;

QgsNetworkAccessManager *QgsNetworkAccessManager::instance()
{
if ( smNAM )
return smNAM;

smNAM = new QgsNetworkAccessManager();
static QgsNetworkAccessManager sInstance;

return smNAM;
return &sInstance;
}

QgsNetworkAccessManager::QgsNetworkAccessManager( QObject *parent )
Expand Down
2 changes: 0 additions & 2 deletions src/core/qgsnetworkaccessmanager.h
Expand Up @@ -102,8 +102,6 @@ class CORE_EXPORT QgsNetworkAccessManager : public QNetworkAccessManager
QStringList mExcludedURLs;

QMap<QNetworkReply*, QTimer*> mActiveRequests;

static QgsNetworkAccessManager *smNAM;
};

#endif // QGSNETWORKACCESSMANAGER_H

0 comments on commit 60b90c7

Please sign in to comment.