QWebengine 程序关闭时异常退出

醉疏雨 2017-06-21 12:08:44
程序关闭退出时,程序异常退出,,程序打出日志,搞不清是什么愿意引起的, 请诸位大神帮忙看看

[0621/110718:FATAL:resource_scheduler.cc(891)] Check failed: client_map_.empty().
Backtrace:
GetHandleVerifier [0x11A31731+277617]
QEnableSharedFromThis<QtWebEngineCore::WebContentsAdapter>::operator= [0x1198440F+3060911]
QtWebEngineCore::FilePickerController::qt_static_metacall [0x107D25F6+6532854]
QtWebEngineCore::FilePickerController::qt_static_metacall [0x1068A3D6+5188822]
QtWebEngineCore::FilePickerController::qt_static_metacall [0x1068A016+5187862]
QtWebEngineCore::FilePickerController::qt_static_metacall [0x1069D550+5267024]
QtWebEngineCore::FilePickerController::qt_static_metacall [0x1069D4CA+5266890]
QtWebEngineCore::FilePickerController::qt_static_metacall [0x1069293D+5222973]
QtWebEngineCore::FilePickerController::qt_static_metacall [0x107259D1+5825233]
QEnableSharedFromThis<QtWebEngineCore::WebContentsAdapter>::operator= [0x11833C4A+1682666]
QtWebEngineCore::FilePickerController::qt_static_metacall [0x10693B9C+5227676]
QEnableSharedFromThis<QtWebEngineCore::WebContentsAdapter>::operator= [0x116FFFFF+422047]
GetHandleVerifier [0x11A4DC3D+393597]
QEnableSharedFromThis<QtWebEngineCore::WebContentsAdapter>::operator= [0x119939D8+3123832]
QEnableSharedFromThis<QtWebEngineCore::WebContentsAdapter>::operator= [0x119920A4+3117380]
QEnableSharedFromThis<QtWebEngineCore::WebContentsAdapter>::operator= [0x119925ED+3118733]
GetHandleVerifier [0x11A503E2+403746]
GetHandleVerifier [0x11A51E82+410562]
GetHandleVerifier [0x11A51DEC+410412]
QEnableSharedFromThis<QtWebEngineCore::WebContentsAdapter>::operator= [0x119937E7+3123335]
QEnableSharedFromThis<QtWebEngineCore::WebContentsAdapter>::operator= [0x119C3016+3317942]
QEnableSharedFromThis<QtWebEngineCore::WebContentsAdapter>::operator= [0x1199369D+3123005]
QEnableSharedFromThis<QtWebEngineCore::WebContentsAdapter>::operator= [0x119D9C66+3411206]
QtWebEngineCore::FilePickerController::qt_static_metacall [0x10611624+4693796]
QtWebEngineCore::FilePickerController::qt_static_metacall [0x1061243B+4697403]
QEnableSharedFromThis<QtWebEngineCore::WebContentsAdapter>::operator= [0x119DA769+3414025]
QEnableSharedFromThis<QtWebEngineCore::WebContentsAdapter>::operator= [0x119E14F6+3442070]
BaseThreadInitThunk [0x76E3336A+18]
RtlInitializeExceptionChain [0x77CE9902+99]
RtlInitializeExceptionChain [0x77CE98D5+54]


程序异常结束。
...全文
787 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
醉疏雨 2017-06-22
  • 打赏
  • 举报
回复
感谢您的指点, 我已经找到了原因啦, 就是因为内存泄露, 我有一个单例类管理各个dialog,程序退出时没有对各个dialog进行清除
赵4老师 2017-06-22
  • 打赏
  • 举报
回复
引用 2 楼 u012894998 的回复:
强制关闭进程,这样不要吧,主要是要弄明白问题产生的原因
你非要钻牛角尖弄明白问题产生的原因: 崩溃的时候在弹出的对话框按相应按钮进入调试,按Alt+7键查看Call Stack即“调用堆栈”里面从上到下列出的对应从里层到外层的函数调用历史。双击某一行可将光标定位到此次调用的源代码或汇编指令处,看不懂时双击下一行,直到能看懂为止。 有时不将“调用函数名字+各参数值,进入函数后各参数值,中间变量值,退出函数前准备返回的值,返回函数到调用处后函数名字+各参数值+返回值”这些信息写日志到文件中是无论如何也发现不了问题在哪里的,包括捕获各种异常、写日志到屏幕、单步或设断点或生成core或dmp文件、……这些方法都不行! 写日志到文件参考下面:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _MSC_VER
    #pragma warning(disable:4996)
    #include <windows.h>
    #include <io.h>
#else
    #include <unistd.h>
    #include <sys/time.h>
    #include <pthread.h>
    #define  CRITICAL_SECTION   pthread_mutex_t
    #define  _vsnprintf         vsnprintf
#endif
//Log{
#define MAXLOGSIZE 20000000
#define MAXLINSIZE 16000
#include <time.h>
#include <sys/timeb.h>
#include <stdarg.h>
char logfilename1[]="MyLog1.log";
char logfilename2[]="MyLog2.log";
static char logstr[MAXLINSIZE+1];
char datestr[16];
char timestr[16];
char mss[4];
CRITICAL_SECTION cs_log;
FILE *flog;
#ifdef _MSC_VER
void Lock(CRITICAL_SECTION *l) {
    EnterCriticalSection(l);
}
void Unlock(CRITICAL_SECTION *l) {
    LeaveCriticalSection(l);
}
#else
void Lock(CRITICAL_SECTION *l) {
    pthread_mutex_lock(l);
}
void Unlock(CRITICAL_SECTION *l) {
    pthread_mutex_unlock(l);
}
#endif
void LogV(const char *pszFmt,va_list argp) {
    struct tm *now;
    struct timeb tb;

    if (NULL==pszFmt||0==pszFmt[0]) return;
    _vsnprintf(logstr,MAXLINSIZE,pszFmt,argp);
    ftime(&tb);
    now=localtime(&tb.time);
    sprintf(datestr,"%04d-%02d-%02d",now->tm_year+1900,now->tm_mon+1,now->tm_mday);
    sprintf(timestr,"%02d:%02d:%02d",now->tm_hour     ,now->tm_min  ,now->tm_sec );
    sprintf(mss,"%03d",tb.millitm);
    printf("%s %s.%s %s",datestr,timestr,mss,logstr);
    flog=fopen(logfilename1,"a");
    if (NULL!=flog) {
        fprintf(flog,"%s %s.%s %s",datestr,timestr,mss,logstr);
        if (ftell(flog)>MAXLOGSIZE) {
            fclose(flog);
            if (rename(logfilename1,logfilename2)) {
                remove(logfilename2);
                rename(logfilename1,logfilename2);
            }
        } else {
            fclose(flog);
        }
    }
}
void Log(const char *pszFmt,...) {
    va_list argp;

    Lock(&cs_log);
    va_start(argp,pszFmt);
    LogV(pszFmt,argp);
    va_end(argp);
    Unlock(&cs_log);
}
//Log}
int main(int argc,char * argv[]) {
    int i;
#ifdef _MSC_VER
    InitializeCriticalSection(&cs_log);
#else
    pthread_mutex_init(&cs_log,NULL);
#endif
    for (i=0;i<10000;i++) {
        Log("This is a Log %04d from FILE:%s LINE:%d\n",i, __FILE__, __LINE__);
    }
#ifdef _MSC_VER
    DeleteCriticalSection(&cs_log);
#else
    pthread_mutex_destroy(&cs_log);
#endif
    return 0;
}
//1-79行添加到你带main的.c或.cpp的那个文件的最前面
//81-86行添加到你的main函数开头
//90-94行添加到你的main函数结束前
//在要写LOG的地方仿照第88行的写法写LOG到文件MyLog1.log中
赵4老师 2017-06-21
  • 打赏
  • 举报
回复
关闭时调用
WinExec("cmd /c taskkill /F /IM 你的程序名.exe",SW_HIDE);
理由请参考:http://bbs.csdn.net/topics/390787357
醉疏雨 2017-06-21
  • 打赏
  • 举报
回复
强制关闭进程,这样不要吧,主要是要弄明白问题产生的原因

24,855

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧