我遇到了内存泄漏问题。 Debug Assertion文件:strcore.cpp行:512 [英] I got a memory leak problems. Debug Assertion file : strcore.cpp line : 512

查看:238
本文介绍了我遇到了内存泄漏问题。 Debug Assertion文件:strcore.cpp行:512的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。

我遇到了程序泄漏内存并发生错误的问题。消息说它导致文件:strcore.cpp和第512行。正如你所看到的,我正在使用VS6.0 MFC程序。所以,我已经发现ReleaseBuffer的代码行为
CString。我们已经在程序中使用了releasebuffer函数很长一段时间,但从未发生过像这样的事情。

I've got some problems that program leaks memory and occurs errors. The message said it cause where file : strcore.cpp and line 512. As you can see I'm using VS6.0 MFC programs. So, I've already found that line of code that was ReleaseBuffer function for CString. We've been using releasebuffer function in the program for a very long long time but never happened like this.

所以我想知道在512版本会导致调试断言错误的情况line strcore.cpp。我相信这对我解决这个问题真的很有帮助。

So I want to know what case it would happen to cause debug assertion error in 512 line strcore.cpp. I believe it would be really helpful for me to figure this problem out.

我很期待你的回答。

谢谢你提前。

推荐答案

好吧,strcore.cpp第512行的ASSERT是 -

Well, the ASSERT on line 512 of strcore.cpp is -

ASSERT(nNewLength <= GetData()->nAllocLength);

其中nNewLength是CString的参数: :ReleaseBuffer(int nNewLength)。

where nNewLength is the parameter to CString::ReleaseBuffer(int nNewLength).

因此,您应该调试代码以确定发生这种情况的原因。 这似乎不是我内存泄漏的结果。 在调试构建内存中,泄漏显示在调试器的输出窗格中,它们不会导致断言错误。

So you should debug your code to determine why this occurs.  This doesn't seem to me to be the result of a memory leak.  In a debug build memory leaks are shown in the debugger's Output Pane, they don't cause an assert error.


这篇关于我遇到了内存泄漏问题。 Debug Assertion文件:strcore.cpp行:512的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆