Georg Baum wrote:
Am Samstag, 14. Oktober 2006 13:20 schrieb Abdelrazak Younes:
Georg Baum wrote:
What I do not understand is why it works on windows this way but did
not
with the old approach.
My explanation yesterday did not satisfy you?
It did, but I do not understand what is different now. I think the main
point is this snippet from your message:
"The problem is that QApplication::exit() was called somewhere during
LyX::ref().exec2() which caused the QApplication instance to disappear.
The static trick enabled us to make this instance persistent across
functions."
We still call QApplication::exit() in LyX::exec2() if something goes wrong.
The destruction of the Application object does still happen after calling
LyX::exec2(), so why are the problems gone?
The exit() call stops the event processing. There is no QTimer available
any more. Some QObjects were still not killed at this time
(socket_callbacks contains QObjects) and where trying to access the main
QTimer which was already dead. This is not happening any more. I think
this is due to my reorganisation work and the elimination of global
variables.
Every QObject used is now created within the Application context. My
understanding is that this ensure that it is properly shut down.
BTW, you should now merge LyX::exec2 with LyX::pricv_exec(). exec2 was only
created to be able to use the Application object as an autonatic variable
and is not needed anymore.
Indeed.
Abdel.