views:

82

answers:

2

Hi, I'm writing a QT4.6 application(without the qt designer) and when I close the program I get this error from 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.

Here is the source code:

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

What's wrong?

A: 

I had the same error last month but since lots of different problems can cause it, I'm not sure my answer will help you.

This was caused by a derived class (Child) without virtual destructor. The error pops up each time the debugger was entering the destructor of Child. Since I'm at work and can not access to the website to get source code I can not check this.

Hope this may help you

Patrice Bernassola
I've added the files to pastebin, you can check it.I'll try your suggestion, maybe that helps.
Roland Soós
+4  A: 

In ExtWiiMote.h you declared

QLabel* dots[3][3];

and in the ExtWiiMote.cpp you use dots[3][0]....

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

Nick D
Thank you, that was the problem!
Roland Soós