Skip to content

Commit

Permalink
QNetworkAccessManager: optimize QNetworkAccessAuthenticationManager a…
Browse files Browse the repository at this point in the history
…llocation

Use QSharedPointer<T>::create(), which co-locates the refcount with the payload
in a single memory allocation, instead of QSharedPointer<T>(new T), which causes
two allocations.

Change-Id: I58196b6390dcc9bd52417e279fd9e000ab9ee9cc
Reviewed-by: Richard J. Moore <[email protected]>
  • Loading branch information
marc-kdab authored and The Qt Project committed Apr 11, 2014
1 parent 0b2bd6b commit c501eb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/network/access/qnetworkaccessmanager_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class QNetworkAccessManagerPrivate: public QObjectPrivate
initializeSession(true),
#endif
cookieJarCreated(false),
authenticationManager(new QNetworkAccessAuthenticationManager)
authenticationManager(QSharedPointer<QNetworkAccessAuthenticationManager>::create())
{ }
~QNetworkAccessManagerPrivate();

Expand Down

0 comments on commit c501eb8

Please sign in to comment.