a text on optimizing C++
David Leimbach
kde-optimize@mail.kde.org
Sat, 25 Jan 2003 15:13:23 -0600
On Saturday, January 25, 2003, at 10:33 AM, Waldo Bastian wrote:
> 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.
>
Thanks... I looked it up... neat system! Allows for more dynamic
dialogs and forms... pretty cool stuff :)
In case anyone else is interested here is the link that helped explain
it...
http://doc.trolltech.com/3.1/objecttrees.html
as well as
http://doc.trolltech.com/3.1/qobject.html