Complete code is required to pinpoint the problem - you can prepare a stripped down example.
Apart from this you have an error in "Ticket delete code". You should not delete list[size-1] because you moved it to size-2 in the loop. In other words, when you delete one element, there must be only one delete operator (you have two).
It's hard to see what you are doing. As @Stanislav Korotky points out, you need to show all your code.
One tip:
Whenever removing a single (or just a few) item from a list, always use a loop in reverse.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello
I have a problem.
I don't know why there occurs memory leak.
I made class Ticket.mqh and TicketList.mqh(Vector)
It is made for a convenient order.
The destructor also work properly.
But error of memory leak occurs.
I'm using two class and some objects (Label)
This below of code is related create and delete.
<List create code>
<Ticket create code>
<Member variable of List>
<Ticket delete code>
<Vector delete code>
delete &v;
Please some body help me ...
Thank you for sparing your time.