Information about memory leaks

Dr Matthias Hammelsbeck
678

Hi,

please see the following EA:

class A {
private:
  string m_name;
public:
  A() {
    m_name = "Happy Trading";
    PrintFormat ("%s", m_name);
  }
  ~A() {
    Print ("End");
  }
};
int OnInit() {
  A *a;
  a = new A;
  return INIT_SUCCEEDED;
}
void OnDeinit (const int reason) {
  Print ("Memory Leaks:");
}

If I apply this EA directly to a chart  (demo account) and remove it again from the chart I get the following info about the obvious memory leak in the Experts Tab:

2021.11.29 19:45:09.154 Memory (EURUSD,H1)      Happy Trading
2021.11.29 19:45:12.623 Memory (EURUSD,H1)      Memory Leaks:
2021.11.29 19:45:12.623 Memory (EURUSD,H1)      1 undeleted objects left
2021.11.29 19:45:12.623 Memory (EURUSD,H1)      1 object of type A left
2021.11.29 19:45:12.623 Memory (EURUSD,H1)      64 bytes of leaked memory

That is wonderful!


But in the strategy tester I cannot find this information. Nowhere. Or I'm blind?

Matthias

Alexandre Borela
13325
Dr Matthias Hammelsbeck:

Hi,

please see the following EA:

If I apply this EA directly to a chart  (demo account) and remove it again from the chart I get the following info about the obvious memory leak in the Experts Tab:

That is wonderful!


But in the strategy tester I cannot find this information. Nowhere. Or I'm blind?

Matthias

int OnInit() {
  A *a;
  a = new A; // You allocated memory here but never deleted the object.

  // Delete it when you don't need it anymore.
  delete a;
  return INIT_SUCCEEDED;
}
Dr Matthias Hammelsbeck
678
Alexandre Borela #:
Thanks for your answer. 
But I want to see information about memory leaks in the strategy tester in order to correct them.
In the EA given above I intentionally forget the delete statement. 
Alexandre Borela
13325
Dr Matthias Hammelsbeck #:
Thanks for your answer. 
But I want to see information about memory leaks in the strategy tester in order to correct them.
In the EA given above I intentionally forget the delete statement. 
You are correct, it looks like the error message does not appear on the strategy tester and it would be an useful feature for complex EAs.
Dr Matthias Hammelsbeck
678
Alexandre Borela #:
You are correct, it looks like the error message does not appear on the strategy tester and it would be an useful feature for complex EAs.
This is exactly what I mean. How can we motivate Metaquotes to implement this feature?