Hi,
as I see, there is no chance to debug the OnDeinit() when the chart is getting closed by the user by clicking the "X" at the right upper corner of the chart window. The debugger does simply never execute the function, while the live-code is executing it, of course.
I face the issue, that I have completely different behavior of an EA between execution of OnDeinit() after ExpertRemove() and after manual chart closing. OnDeinit() has no issues when ExpertRemove() was called, but when the chart was closed manually, destroying process for <>1.000 objects takes <>4 seconds. Of course it must be a matter of my code, but how can I figure out the origin when I am not able to debug it? Is there a way to at least pretend this way of termination?
Thx.
Are you talking about chart objects or OOP objects ?
More than 1.000 chart objects
Hi,
as I see, there is no chance to debug the OnDeinit() when the chart is getting closed by the user by clicking the "X" at the right upper corner of the chart window. The debugger does simply never execute the function, while the live-code is executing it, of course.
I face the issue, that I have completely different behavior of an EA between execution of OnDeinit() after ExpertRemove() and after manual chart closing. OnDeinit() has no issues when ExpertRemove() was called, but when the chart was closed manually, destroying process for <>1.000 objects takes <>4 seconds. Of course it must be a matter of my code, but how can I figure out the origin when I am not able to debug it? Is there a way to at least pretend this way of termination?
Thx.
That does not need to be an issue of your code
OnDeinit() is placed into a queue (the same as class destructors) and is executed "when the terminal has some spare time" sort of speaking - hence that 4 seconds "pause" is not necessarily a result of your code issue. Use Print, and you shall see it in log file when it executes with that delay
Some more information here : https://www.mql5.com/en/forum/160715/page2
- 2016.11.10
- www.mql5.com
I already got an issue with ObjectsDeleteAll() with a chart closed. Detect it and don't delete the objects, not needed as the chart is closed anyway. I hope it helps.
Will give it a try ... thx
That does not need to be an issue of your code
OnDeinit() is placed into a queue (the same as class destructors) and is executed "when the terminal has some spare time" sort of speaking - hence that 4 seconds "pause" is not necessarily a result of your code issue. Use Print, and you shall see it in log file when it executes with that delay
Some more information here : https://www.mql5.com/en/forum/160715/page2
It does not execute. Never. There is already a Print()-command which just says "Bye". Never seen it.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
as I see, there is no chance to debug the OnDeinit() when the chart is getting closed by the user by clicking the "X" at the right upper corner of the chart window. The debugger does simply never execute the function, while the live-code is executing it, of course.
I face the issue, that I have completely different behavior of an EA between execution of OnDeinit() after ExpertRemove() and after manual chart closing. OnDeinit() has no issues when ExpertRemove() was called, but when the chart was closed manually, destroying process for <>1.000 objects takes <>4 seconds. Of course it must be a matter of my code, but how can I figure out the origin when I am not able to debug it? Is there a way to at least pretend this way of termination?
Thx.