1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 19:30:21 +02:00

Avoid copying of constructor results

This commit is contained in:
Lorenz Hübschle-Schneider
2014-10-21 14:46:55 +02:00
parent fee1e7c349
commit 645f09d514
2 changed files with 2 additions and 2 deletions

View File

@@ -95,7 +95,7 @@ localFileIODeviceFactory( const Tomahawk::result_ptr&, const QString& url,
io->open( QIODevice::ReadOnly );
// std::functions cannot accept temporaries as parameters
QSharedPointer< QIODevice > sp = QSharedPointer<QIODevice>( io );
QSharedPointer< QIODevice > sp( io );
callback( url, sp );
}

View File

@@ -903,7 +903,7 @@ void
JSResolverHelper::gotStreamUrl( std::function< void( const QString&, QSharedPointer< QIODevice >& ) > callback, NetworkReply* reply )
{
// std::functions cannot accept temporaries as parameters
QSharedPointer< QIODevice > sp = QSharedPointer< QIODevice >( reply->reply(), &QObject::deleteLater );
QSharedPointer< QIODevice > sp ( reply->reply(), &QObject::deleteLater );
QString url = reply->reply()->url().toString();
reply->disconnectFromReply();
reply->deleteLater();