I'm writing an app in QT. I'd like to use QButtonGroup
, so I declear it in header file of user interface class:
std::unique_ptr<QButtonGroup> examTypeSelectGroup;
But when I close application, I recive the error:
Run-Time Check Failure #2 - Stack around the variable 'w' was corrupted.
in last line of main.cpp file, which was a mian file of a project. Call stack when error occures have only main()
:
> OCT_main.exe!main(int argc, char * * argv) Line 14
[External Code]
Error occures both, when I tried to use object, and when I don't use it (just declare it). Have you got any idea, what happend.
main.cpp:
1 #include "oct_main.h"
2
3 #include <QApplication>
4
5 int main(int argc, char *argv[])
6 {
7 QApplication a(argc, argv);
8
9 //run window
10 OCT_main w;
11 w.show();
12
13 return a.exec();
14 }
EDIT: using QButtonGroup examTypeSelectGroup;
make error during destruct a button group, so it was bad way too.