Hello Everyone
I have this warning message, and have checked all my classes where I have created CMarketInfo class and made sure that it is deleted on Exit the program.
2024.06.10 17:28:54.019 AlgoEA (XAUUSD,M15) 1 undeleted objects left
2024.06.10 17:28:54.019 AlgoEA (XAUUSD,M15) 1 object of type CMarketInfo left
2024.06.10 17:28:54.019 AlgoEA (XAUUSD,M15) 32 bytes of leaked memory
you simply need to check your source code and make sure that you are doing things correctly, you could print a message to the journal everytime you create and delete then you will have a starting point.
So unless you post your code here, there is not much more anyone can say.
Hello Everyone
I have this warning message, and have checked all my classes where I have created CMarketInfo class and made sure that it is deleted on Exit the program.
2024.06.10 17:28:54.019 AlgoEA (XAUUSD,M15) 1 undeleted objects left
2024.06.10 17:28:54.019 AlgoEA (XAUUSD,M15) 1 object of type CMarketInfo left
2024.06.10 17:28:54.019 AlgoEA (XAUUSD,M15) 32 bytes of leaked memory
Are you calling an instance "new" if so, you should use "delete" in OnDeInit()
https://www.mql5.com/en/book/oop/classes_and_interfaces/classes_new_delete_pointers
- www.mql5.com
Are you calling an instance "new" if so, you should use "delete" in OnDeInit()
https://www.mql5.com/en/book/oop/classes_and_interfaces/classes_new_delete_pointers
Thanks Rajesh, yes I am aware of instance as 'new' and always make sure I delete them in deconstructor() or OnDeInit().
However, it seems I have forgot to do that somewhere. I have looked at all possible places where I have created them with 'new' and all the places command is appropriately placed for deleting it.
Still this once pops up, I was wondering if there is any way to find where it could be.
you simply need to check your source code and make sure that you are doing things correctly, you could print a message to the journal everytime you create and delete then you will have a starting point.
So unless you post your code here, there is not much more anyone can say.
Hi Paul
There are more than 30 files with 5000+ lines of code. Do you think someone at forum will have time to look into them? On top of that can someone share his important piece of code at forum!!!
Moreover, I have said very clearly that I know why this warning is given and I do take appropriate action to delete them.
In this particular case, it seems I have forgotten to delete the class.
Was just trying to get help, if there is way to find out which file has caused this warning.
Hi Paul
There are more than 30 files with 5000+ lines of code. Do you think someone at forum will have time to look into them? On top of that can someone share his important piece of code at forum!!!
Moreover, I have said very clearly that I know why this warning is given and I do take appropriate action to delete them.
In this particular case, it seems I have forgotten to delete the class.
Was just trying to get help, if there is way to find out which file has caused this warning.
I never said you should share the code, I said if you want anyone to comment further then you would need to share the code.....
I've told you how to narrow it down, 5000 lines of code is not too much to debug you will just have to get busy, there are no tools beyond what is in the editor
What debugging are you talking about? How many instances of CMarketInfo do you have? I think you probably only have 1 instance of this class. Just make sure you delete it when deinitializing.
I never said you should share the code, I said if you want anyone to comment further then you would need to share the code.....
I've told you how to narrow it down, 5000 lines of code is not too much to debug you will just have to get busy, there are no tools beyond what is in the editor
Thanks Paul
I think I have got a solution to find it, as load it from a single file, I can disable the load and will get error of not finding this class. I can check it from there.
You mentioning to share the code (if I need a solution) was not needed at all. I have tried this in past and most of the time it get unchecked.
'there are no tools beyond what is in the editor' is the right and good enough answer to my problem.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello Everyone
I have this warning message, and have checked all my classes where I have created CMarketInfo class and made sure that it is deleted on Exit the program.
2024.06.10 17:28:54.019 AlgoEA (XAUUSD,M15) 1 undeleted objects left
2024.06.10 17:28:54.019 AlgoEA (XAUUSD,M15) 1 object of type CMarketInfo left
2024.06.10 17:28:54.019 AlgoEA (XAUUSD,M15) 32 bytes of leaked memory