[Development] [Interest] Valgrind messages Qt 4.8.2

Linos info at linos.es
Tue Jul 31 11:15:30 CEST 2012


On 31/07/12 10:07, Olivier Goffart wrote:
> On Tuesday 31 July 2012 09:49:44 Linos wrote:
>> Hi,
>> 	i am using valgrind integration in Qt Creator, works fine for me, after
>> check an old small project of mine that have been some time untouched it
>> remains having 0 errors but now if i use valgrind from the command line
>> like i did when i fixed memory errors in this project (using the same
>> suppression file) i get what seems to be Qt internal errors that i didn't
>> find in Qt 4.6.x versions.
> [...]
>> don't know why because everytime fill() gets called this gets called before:
>>
>> void CameraLayout::clear(){
>>     for (int r = 0; r < rowCount(); ++r ){
>>         for (int c = 0; c < columnCount(); ++c ){
>>                 QLayoutItem *item = itemAtPosition( r, c );
>>                 if ( item ){
>>                         removeItem( item );
> 
> 
> The documentation of QLayout::removeItem states:
> "It is the caller's responsibility to delete the item."
> 
> In other words, you must delete 'item' and you do not seem to.
> 
> 
>>                         if ( item->widget() ){
>>                             BlackWidget *bw = qobject_cast < BlackWidget *>
>> ( item->widget() );
>>                             if ( bw ) delete bw;
>>                             //else is camera o similar
>>                             else item->widget()->setVisible( false );
>>                         }
>>                 }
>>             }
>>         }
> 
> 

oops thanks for the tip, still leaks after "delete item" added to
"CameraLayout::clear()" though with the exact same error as before, anyway about
the internal Qt leaks i attached that were from an internal project that didn't
leak with Qt 4.6.3 what do you think?

Regards,
Miguel Angel.



More information about the Development mailing list