c++ - Qt 堆内存损坏

标签 c++ windows visual-c++ qt

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

Windows has triggered a breakpoint in Test.exe.

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.

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

The output window may have more diagnostic information.

这是源代码:

(你编译不了,我没法分享用过的库)

怎么了?

最佳答案

ExtWiiMote.h 中你声明了

QLabel* dots[3][3];

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

修复 dots 数组大小,也许你会没事的。

关于c++ - Qt 堆内存损坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3574147/

相关文章:

c++ - C++ 中用于可变长度记录的无锁共享内存

c++ - 从文本文件创建和填充 ROOT 文件

windows - 调用 GetExtendedTcpTable () 时出现空响应

windows - 使用 sc.exe 使用当前用户帐户创建 Windows 服务

visual-c++ - 删除 cmake 上的默认标志

c++ - 我在 Xcode 中使用 C++11 时遇到一些问题

c++ - 覆盖 operator[] 和调用方法

c++ - Windows中有没有办法知道进程是否没有响应?

c++ - 在 vc++ 中使用模板限制类型

c++ - VS 2008 和 VS 2017 中静态数组的不同行为