engine/savable.cpp memory leak?

Dan Leinir Turthra Jensen admin at leinir.dk
Sat May 7 11:48:26 CEST 2011


On Saturday 07 May 2011 02:22:37 Diego Giagio wrote:
> 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.

  Well spotted - i'll get right on that :)

-- 
..Dan // Leinir..
http://leinir.dk/

                          Co-
                            existence
                          or no
                            existence

                          - Piet Hein


More information about the Gluon mailing list