Qt 调试时 程序异常结束

在调试时,关闭窗口,应用程序输出窗口提示 “Qt 调试时 程序异常结束”

21:20:48: 程序异常结束。
21:20:48: The process was ended forcefully.
21:20:48: G:\project\tester\build-qapplication-Desktop_Qt_5_12_12_MinGW_32_bit-Debug\debug\qapplication.exe crashed.

通过调试发现,程序结束在析构函数的地方报了段错误。

testOptionNetWorkRemote::~testOptionNetWorkRemote()
{
    
    
    disconnect(&process, SIGNAL(finished(int)), this, SLOT(processFinished(int)));
    disconnect(&process, &QProcess::readyReadStandardOutput, this, &testOptionNetWorkRemote::onReadOutput);
    delete [] widget_params;
}

暂时还不知道是怎么回事。在构造时,指定了parent为ui。在构造时,不指定parent可以解决这个问题。后面再看看Qt的元对象系统看是咋个回事。

猜你喜欢

转载自blog.csdn.net/duapple/article/details/129540910
今日推荐