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

To add comments, please log in or register
liregood
16
liregood  

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.

whroeder1
17942
whroeder1  
liregood: in the OnDeinit function I called ExpertRemove function

So don't do that.

liregood
16
liregood  
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.

Alain Verleyen
36131
Alain Verleyen  
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.

liregood
16
liregood  
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
16
liregood  
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):

To add comments, please log in or register