Qt implements object assignment.  One such object is a pointer
(similar pointers are implemented in other C++ dialects) that
increments a reference count in the addressed object when constructed,
decrements on destruction.  You can assign the pointer and it's
copied, with appropriate incrementing.  If you use the right flavor
pointer (there are several) the object will be be deleted when the
reference count goes to zero.  Other flavors (linked in a reference
chain) act like weak references and go null when the object is
deleted.

All rather automatic (and atomic), with lots of (ahem, shall we say)
"less than stellar" programmers using the stuff and only occasionally
screwing it up.

On Jul 26, 3:49 pm, Bob Kerns <r...@acm.org> wrote:
> Um, no. For Qt to do what you claim, it would have to traverse all the
> application data -- including data owned by non-Qt code -- to discover
> what application objects are still in use. In other words, it would
> have to implement a GC.
>
> Unless your definition of "almost exactly the same stuff" is a lot
> looser than what I would think.
>
> Would you care to give an example of which Qt API you mean? And
> perhaps what binding, if that's relevant?
>
> On Jul 26, 4:13 am, DanH <danhi...@ieee.org> wrote:
>
> > That's odd, because Qt can do almost exactly the same stuff, without
> > weak references or implicit garbage collection, using reference chains
> > that the average user never has to think about.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to