我遇到了 glibc 检测到的问题。我已经研究了解决这个问题的方法,但似乎正确的解决方案是释放我分配的任何内容。然而,即使我这样做了,我仍然会在输出屏幕上收到内存映射打印。
class TestDepth{
gameStatus temp;
public:
TestDepth(gameStatus ¤tGameState)
{
temp = currentGameState;
free(&temp);
}
};
只有在放置 temp=currentGameState
行时才会出现此错误。但是一旦我评论出来,它就可以正常工作。
最佳答案
As you can see, I'm having a glibc detected problem. I have research a way to solve this however it seems like the correct solution is to free whatever I have allocated.
您没有分配任何东西。你不应该释放任何东西。
关于c++ - glibc 检测到双重释放或损坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11173935/