C++ static classes & shared_ptr memory leaks

后端 未结 3 891
执念已碎
执念已碎 2021-01-12 00:19

I can\'t understand why does the following code produce memory leaks (I am using boost::shared_ptr with static class instance). Could someone help me?



        
3条回答
  •  Happy的楠姐
    2021-01-12 00:40

    Most likely the leak is detected before the global objects get destroyed and shared_ptr has a chance to release the object, so it's likely a false leak.

提交回复
热议问题