a text on optimizing C++

Waldo Bastian kde-optimize@mail.kde.org
Sat, 25 Jan 2003 17:33:33 +0100


On Saturday 25 January 2003 02:27, David Leimbach wrote:
> > > > ( new QVBoxLayout( ... ) )->setAutoAdd( true );
> > >
> > > Looks like a memory leak to me.. . you just constructed something and
> > > threw out the pointer
> >
> > The QVBoxLayout is created as a child of a widget. The widget is
> > responsible for deleting the layout. So there's no memory leak.
>
> So somewhere there is a symbol that has that address so it can call delete.

Yes, I suggest you read the Qt manual wrt QObject, section child objects.

Cheers,
Waldo
-- 
bastian@kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian@suse.com