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:
@@ -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 );
|
||||
}
|
||||
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user