40 views
in Embedded Wizard Studio by

Hello, this is more of a bug report than a question. I beleive I've ran into a bug in the way EW optimises timers, see the attached project. If you place a timer in a derived DeviceClass (something defining the interface with the application) the timer will only start running if something else is connected to that DeviceClass, even if that something else isn't using the timer.

I assume that this is to do with EW optimising and ignoring the whole interface if nothing in the application is calling a slot in it. However it is still an unexpected behaviour (that has wasted some of my time).

Tested in EW pro 13.05, see attached projects

https://ask.embedded-wizard.de/?qa=blob&qa_blobid=5188854797294239496

Please let me know if there is a better place to report this then on the forum.

Thank you!

 

1 Answer

0 votes
by

Hello,

first of all, thanks for your feedback and the preparation of the example.

But anyhow, I think this is rather a misunderstanding than a bug.

Please note, that any autoobject is instantiated as soon as it is needed. Autoobjects are created as soon as they are referenced from somewhere in your GUI code and they are deleted as soon as they are no more referenced. See also lifetime of autoobjects.

Typically, a variable within the application class that refers to the device class ensures that the device class is always alive In order to prevent the Garbage Collector from freeing an autoobject, please add a variable to the root class, set the type to your class Application::DeviceClass and the value to the instance (autoobject) of the class.

Does this solve the issue?

Best regards,

Manfred.

by
Thank you for your response. Yes, that does make sense. Thank you!

Embedded Wizard Website | Privacy Policy | Imprint

...