I'm new to programming and have gotten stuck on how I can delete my pointer arrays before termination.
Cuz MT4 crashes when I try to add the EA with the reason timeout.
this is the code and arrays I need to terminate:
string parts[];
StringSplit(row, ' ', parts);
int len = ArraySize(parts);
string debug = "";
for(int k = 0; k < len; k++)
debug += "|" + parts[k];
if(len != 7)
continue;
Signal *s = new Signal();
s.signal_time = time;
s.order_type = parts[4] == "BUY" ? OP_BUYLIMIT : OP_SELLLIMIT;
s.symbol = parts[0];
m_signals.Add(s);
I'm very thankful for all help with this :D
Gotten this far:
void SignalList::Signal
{
//--- service pointer for working in the loop
CObject* Signal;
//--- go through loop and try to delete dynamic pointers
while(CheckPointer(m_signals) != POINTER_INVALID)
{
Signal *s = new Signal();
m_signals=m_signals.Next();
if(CheckPointer(Signal)==POINTER_DYNAMIC)
{
Print("Dynamic object ", Signal.Identifier(), " to be deleted");
delete (Signal);
}
else Print("Non-dynamic object ", Signal.Identifier(), " cannot be deleted");
}
//---
}
This is the source code which my code is based upon: https://stackoverflow.com/a/52104040/12452532