Qt堆内存损坏 [英] Qt heap memory corruption

查看:128
本文介绍了Qt堆内存损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写Qt 4.6应用程序(没有qt设计器),并且当我关闭程序时,我从Visual Studio中收到此错误:

I'm writing a Qt 4.6 application (without the qt designer) and when I close the program I get this error from Visual Studio:

Windows已在以下位置触发断点Test.exe.

Windows has triggered a breakpoint in Test.exe.

这可能是由于堆,表明存在错误Test.exe或它具有的任何DLL加载.

This may be due to a corruption of the heap, which indicates a bug in Test.exe or any of the DLLs it has loaded.

这也可能是由于用户在Test.exe具有焦点的情况下按F12.

This may also be due to the user pressing F12 while Test.exe has focus.

输出窗口可能有更多诊断信息.

The output window may have more diagnostic information.

这是源代码:

  • Main.cpp http://pastebin.com/DeUvZSHU
  • TesterWindow.h http://pastebin.com/SEVr8x40
  • TesterWindow.cpp http://pastebin.com/MYUtZZGw
  • Device.h http://pastebin.com/bXKxVrmW
  • Device.cpp http://pastebin.com/H1kMcRes
  • ExtWiiMote.h http://pastebin.com/uX3HT9Yw
  • ExtWiiMote.cpp http://pastebin.com/p2TKZdHv

(您无法编译,我无法共享使用的库)

(You can't compile it, I can't share the used library)

怎么了?

推荐答案

在您声明的 ExtWiiMote.h

QLabel* dots[3][3];

,在 ExtWiiMote.cpp 中,您使用 dots [3] [0] ... .

修正数组的大小,可能会没事的.

Fix dots array size and probably you'll be fine.

这篇关于Qt堆内存损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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