engine/savable.cpp memory leak?

Diego Giagio diego at giagio.com
Sat May 7 03:22:37 CEST 2011


Hi,

It appears engine/savable.cpp has a memory leak on line 68-73:

--
    QFile* savableFile = new QFile( file.toLocalFile() );
    if( !savableFile->open( QIODevice::WriteOnly ) )
    {
        DEBUG_TEXT( QString( "Could not write to file %1" ).arg(
object->property( "file" ).value<QUrl>().toString() ) )
        return false;
    }
--

Perhaps using QScopedPointer in this case is a good idea (and removing
delete statement on line 79). Or add a delete statement before return.

-- 
Diego Giagio
diego at giagio.com / diego at FreeBSD.org


More information about the Gluon mailing list