Following code, running in qtCreator (Windows 10) in the debug mode, does not reach breakpoints "brakepoint1" or "breakpoint2" upon clicking on "x" console window.
What can be the case?
Thanks!
#include <QCoreApplication>
#include <iostream>
#include <signal.h>
void cleanup(int sig)
{
std::cout << sig << "quitting \n"; // breakpoint 2
}
int main(int argc, char *argv[])
{
QObject::connect(&a,
&QCoreApplication
::aboutToQuit,
[&]() { std::cout << "about to quit\n"; //breakpoint 1
});
signal(SIGINT, cleanup);
signal(SIGABRT, cleanup);
signal(SIGTERM, cleanup);
std::cout<< "about to run\n";
return a.exec();
std::cout<< "exiting\n";
}
#include <QCoreApplication>
#include <iostream>
#include <signal.h>
void cleanup(int sig)
{
std::cout << sig << "quitting \n"; // breakpoint 2
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QObject::connect(&a, &QCoreApplication::aboutToQuit, [&]() {
std::cout << "about to quit\n"; //breakpoint 1
});
signal(SIGINT, cleanup);
signal(SIGABRT, cleanup);
signal(SIGTERM, cleanup);
std::cout<< "about to run\n";
return a.exec();
std::cout<< "exiting\n";
}
To copy to clipboard, switch view to plain text mode
Bookmarks