Skip to content
Permalink
Browse files

use static locals instead of global pointers for some singletons

(proably more valgrind happyness; followup 572bda8)
  • Loading branch information
m-kuhn committed Oct 17, 2013
1 parent cca5805 commit 60b90c72c6af6c3cd000f92ebb1649a8441b9c8d
Showing with 2 additions and 9 deletions.
  1. +2 −7 src/core/qgsnetworkaccessmanager.cpp
  2. +0 −2 src/core/qgsnetworkaccessmanager.h
@@ -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 )
@@ -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.
You can’t perform that action at this time.