francesco perillo wrote:
>
> The link I wanted to send warned to never allocate a Qt object on the
> stack...
> some thing like
> func x()
> {
> QPushButton qpb;
> }
> but allways use new operator....
>
This is good for majority of situations but not always.
This all depends on what type of object it is. I mean, if it is
a pointer to an already-on-the-heap object then we must not
allocate double resources plus we may not want a copy of the
original object. For example,
oTextBlock := QTextBlock():from( some_other_call_which_return_textblock )
is never supposed to create via new but to work with original one.
Also we must never delete them because they still are valid life-span.
This complexity has led to use only one GC placeholder which
works in all situations.
Again, I have no issues during the life-time of the object.
The issue arises when parent is destroyed first ( Harbour GC )
and child next, which at that point, has already been destroyed.
-----
enjoy hbIDEing...
Pritpal Bedi
http://hbide.vouch.info/
--
View this message in context:
http://n2.nabble.com/Improve-on-hbqt-object-handling-tp4887521p4890283.html
Sent from the harbour-devel mailing list archive at Nabble.com.
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour