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().
Reason: