Hi,

On Fri, Sep 19, 2014 at 10:37 PM, BogDan <bog_dan...@yahoo.com> wrote:

> Hello folks,
>
>   Singletons registered using qmlRegisterSingletonType, are deleted
> *before*
> the other active objects. I consider it to be wrong because some of the
> active
> objects may still need to access the singletons in their destructor ...
>
> IMHO singletons should be the very last objects deleted (also in the
> reverse
> order).
>

I tend to agree that they should be deleted last.  Enforcing deletion in
the reverse
order to how they were registered might impose some slight performance
penalty
at instantiation time, however, depending on how the deletion order is
determined
at cleanup time, since they are instantiated on demand (and hence possibly
out-of-order).


>
> Is there any reason why they are deleted before the other active objects?
> Or this is just a bug?
>

I don't believe that there is any particular reason for deleting them prior
to other
active objects, but perhaps Simon or Lars can correct me on this point.
Nonetheless, I don't think that the current behaviour is a bug, per-se, as
the
destruction order was never documented or guaranteed, as far as I know.

Cheers,
Chris.


>
> Cheers,
> BogDan.
>
> _______________________________________________
> Development mailing list
> Development@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to