Pure Virtual Method Called

后端 未结 7 1074
盖世英雄少女心
盖世英雄少女心 2021-02-08 10:24

EDIT: SOLVED

I\'m working on a multi-threaded project right now where I have a base worker class, with varying worker classes that inherit from it. At r

7条回答
  •  孤街浪徒
    2021-02-08 10:58

    Without seeing the full code I would hazard a guess that you are stepping out of the boundary of the memory block pointed to by workerPtrArray. It would certainly make sense since it complains about pure virtual function being called. If the memory being dereferenced is garbage then the runtime can't make sense of it at all and weird things happen.

    Try to put asserts into critical places where you are dereferencing the array to make sure that indices make sense. I.e. limit to 4 workers and make sure the id is less than 4.

提交回复
热议问题