shutdown by timeout after recompilation when calling ObjectsDeleteAll for other charts in OnDeinit.

 
int OnInit()
  {
   return(INIT_SUCCEEDED);
  }
void OnDeinit(const int reason)
  {
   for(long chart_id=ChartFirst(),i=0; i<100 && chart_id!=-1; chart_id=ChartNext(chart_id),i++)
     {
      ObjectsDeleteAll(chart_id,"prefix"); //ObjectsDeleteAll causes hang during recompilation when calling for other chart.
     }
  }
void OnTick()
  {
  }

This simple EA will result in Abnormal termination when EA is recompiled.

It is uninitialized normally for other reasons.

There are only 10 charts at current profile of platform and charts have no object.

MT4 build is 1260, on Win 10.

14:40:22.001 Expert test-RecompileObjectsDeleteAll EURUSD,H1: loaded successfully
14:40:29.226 test-RecompileObjectsDeleteAll EURUSD,H1: initialized
14:40:34.911 test-RecompileObjectsDeleteAll EURUSD,H1: uninit reason 2
14:40:42.412 test-RecompileObjectsDeleteAll EURUSD,H1: shutdown by timeout
14:40:49.953 test-RecompileObjectsDeleteAll EURUSD,H1: Abnormal termination
14:40:49.957 Expert test-RecompileObjectsDeleteAll EURUSD,H1: removed
14:40:49.967 Expert test-RecompileObjectsDeleteAll EURUSD,H1: loaded successfully
14:40:49.978 test-RecompileObjectsDeleteAll EURUSD,H1: initialized
14:41:12.893 test-RecompileObjectsDeleteAll EURUSD,H1: uninit reason 1
14:41:12.905 Expert test-RecompileObjectsDeleteAll EURUSD,H1: removed
14:41:15.865 Expert test-RecompileObjectsDeleteAll EURUSD,H1: loaded successfully
14:41:17.490 test-RecompileObjectsDeleteAll EURUSD,H1: initialized
14:41:30.681 test-RecompileObjectsDeleteAll EURUSD,H1: uninit reason 3
14:41:30.818 test-RecompileObjectsDeleteAll EURUSD,H4: initialized

 

I know a workaround would be a condition to check uninitialization reason since end users won't recompile.

This issue is reported to be tested by community and become fixed if it's a bug, or it may save time for someone else in the similar case.

 
Mohammad Hossein Sadeghi:

I know a workaround would be a condition to check uninitialization reason since end users won't recompile.

This issue is reported to be tested by community and become fixed if it's a bug, or it may save time for someone else in the similar case.

Known issue for years (even with 1 chart only). Never succeed to have it fixed, you can try.
Reason: