_DebugHeapDelete Access Violation at termination

后端 未结 4 1577
青春惊慌失措
青春惊慌失措 2021-01-23 00:40

I\'m getting a weird access violation at the end of my main whose cause I\'m having some difficulties finding.

When shutting down my application I get an access violatio

4条回答
  •  花落未央
    2021-01-23 01:14

    If you override the operator new and use you may meet the same cause as me. the code may be like

    #include "yournew" //override new declare .. 
    #include "fstream" 
    std::fstream f
    f.open(...)
    

    because the iostream is template so the new of _Fac_node use your operator new. but when exit, your memory pool may exit before _Fac_tidy, then when ~_Fac_tidy() run,the program crashed.

提交回复
热议问题