Pure virtual function call

 



No further information, impossible to debug, since it happens with indicators when the profile is changed and when the indicator terminates. And it happens after everything is already shut down, like IPC connections etc.
Next problem: It happens sometimes. Randomly. 

Any ideas?

Source code is >39.000 lines of code, plus DLLs (>80.000 lines) - all of such indicators. Makes no sense to post. In general it all works, no problems, just this, unfortunately extremely useless error message, for sure its not line 1, row 1 like shown in the error. 

I can only assume that its happening within an event (Custom event class). But isn't it somehow possible to check such issue upfront or at least to catch such errors? 

 

Make sure you're not calling a pure virtual function from an abstract class's constructor. I've encountered this error a couple of times.

https://www.mql5.com/en/docs/basis/oop/abstract_type

Restrictions on abstract classes

If the constructor for an abstract class calls a pure virtual function (either directly or indirectly), the result is undefined.

//+------------------------------------------------------------------+
//| An abstract base class                                           |
//+------------------------------------------------------------------+
class CAnimal
  {
public:
   //--- A pure virtual function
   virtual void      Sound(void)=NULL;
   //--- Function
   void              CallSound(void) { Sound(); }
   //--- Constructor
   CAnimal()
    {
     //--- An explicit call of the virtual method
     Sound();
     //--- An implicit call (using a third function)
     CallSound();
     //--- A constructor and/or destructor always calls its own functions,
     //--- even if they are virtual and overridden by a called function in a derived class
     //--- If the called function is pure virtual,
     //--- its call will cause a critical runtime error: "pure virtual function call"
    }
  };
However, constructors and destructors for abstract classes can call other member functions.
 
Vladislav Boyko #:

Make sure you're not calling a pure virtual function from an abstract class's constructor. I've encountered this error a couple of times.

Thx. The thing is: I have no such pure virtual definitions at all, since I saw that behavior long time ago, I decided to strictly implement each. 

There must be something going wrong with the global destruction and I assume, MT is canceling the thread when it takes too long to shut down.