Hi,

In gener‎al I agree with Chris. However I'm a little puzzled that this is 
happening. If you take a look at the QQmlEngine destructor you can see that 
singletons are deleted last. So I'm wondering what is happening in your app 
Bogdan. Can you create a minimal test case?

Thanks,
Simon

Fra: Chris Adams
Sendt: 05:45 mandag 22. september 2014
Til: BogDan
Kopi: Qt Development Group
Emne: Re: [Development] [QML] Singletons are deleted before the other objects


Hi,

On Fri, Sep 19, 2014 at 10:37 PM, BogDan 
<[email protected]<mailto:[email protected]>> 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
[email protected]<mailto:[email protected]>
http://lists.qt-project.org/mailman/listinfo/development

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to