issue on "ExpertRemove" function and "7 leaked string left"

 

Hi, everybody

I wrote an EA, in the OnDeinit function I called ExpertRemove function,  when I use the key F7 to change the EA parametres,  the EA didn't reinitialize,it warned me "7 leaked string left", I couldn't find out where  the reason is, I need your help, waiting for your answer, thank you.

 
liregood: in the OnDeinit function I called ExpertRemove function

So don't do that.

 
whroeder1:

So don't do that.

I wrote a GUI object, in the Dialog.mqh file, the CAPPDialog.Destory() function called ExpertRemove() function, when I use Destory() in the OnDeinit(), it will warn me "7 leaked string left", but if I don't call Destory() in OnDeinit(), the chart will have more than one GUI object.

 
liregood:

I wrote a GUI object, in the Dialog.mqh file, the CAPPDialog.Destory() function called ExpertRemove() function, when I use Destory() in the OnDeinit(), it will warn me "7 leaked string left", but if I don't call Destory() in OnDeinit(), the chart will have more than one GUI object.

No need to call ExpertRemove in OnDeinit().

Call Destroy() and fix your code. You have some objects remaining in memory.

 
Alain Verleyen:

No need to call ExpertRemove in OnDeinit().

Call Destroy() and fix your code. You have some objects remaining in memory.

can  you tell me how to check out which object is left
 
liregood:
can  you tell me how to check out which object is left

and when the EA parameters changed from parameters dialog, EA need to reninitialize, if i don't put the destroy() function in OnDeinit(),  how to move the GUI object?

I test without GUI codes, it also have "leaked string left" problems.


my GUI is like this(use the standard libraries):

Reason: