EA shutdown by timeout , possible causes ?

 
I have coded an EA and whenever I try to remove the EA from the chart Mt4 gets frozen for some time and then I receive the message "EA shutdown by time out" in the experts log.
and sometimes when I try to remove the EA it just closes down the Mt4 as soon as I click the Remove option.
the way  I am removing the Expert is like this  : I right click  on the chart and move the cursor to Expert Advisors and then click Remove.
I am not using any DLL or any other library.
there is no timer event in the EA as well.

What are some of the most common reasons for a behavior like this ?

Thank you
 
Possibly you have an endless loop in OnDeinit().
 
Arad S:
I have coded an EA and whenever I try to remove the EA from the chart Mt4 gets frozen for some time and then I receive the message "EA shutdown by time out" in the experts log.
and sometimes when I try to remove the EA it just closes down the Mt4 as soon as I click the Remove option.
the way  I am removing the Expert is like this  : I right click  on the chart and move the cursor to Expert Advisors and then click Remove.
I am not using any DLL or any other library.
there is no timer event in the EA as well.

What are some of the most common reasons for a behavior like this ?

Thank you

Hello,

3 years later...I just had the problem.

Maybe you call an indicator ?

Make sure it's the right one and isn't too heavy/consuming.

 

Just to be precise, the MT4 / MQL5 documentation says: The OnDeinit() function run is restricted to 2½ seconds.