Skip to content

Commit

Permalink
fix: 修复关闭程序产生coredump问题 (#513)
Browse files Browse the repository at this point in the history
修复关闭程序产生coredump问题

Log: 修复关闭程序产生coredump问题
Bug: https://pms.uniontech.com/bug-view-291437.html
  • Loading branch information
lzwind authored Dec 12, 2024
1 parent 4324ba7 commit 500a49b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/controller/helpermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,33 @@ helperManager::helperManager(QObject *parent)
initConnect();
}

helperManager::~helperManager()
{
disconnect(jsObj, &JsContext::parseMsg, this, &helperManager::onRecvParseMsg);
disconnect(watcherObj, &fileWatcher::filelistChange, this, &helperManager::onFilelistChange);
disconnect(timerObj, &QTimer::timeout, this, &helperManager::onTimerOut);
if(timerObj)
{
timerObj->stop();
}
if(m_webView && m_webChannel)
{
m_webChannel->deleteLater();
delete m_webChannel;
m_webChannel = nullptr;

disconnect(m_webView->page(), &QWebEnginePage::loadFinished, this, &helperManager::webLoadFinish);
m_webView->deleteLater();
delete m_webView;
m_webView = nullptr;
}
if(dbObj)
{
delete dbObj;
dbObj = nullptr;
}
}

/**
* @brief helperManager::initWeb 初始化web配置
*/
Expand Down
1 change: 1 addition & 0 deletions src/controller/helpermanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class helperManager : public QObject
Q_OBJECT
public:
explicit helperManager(QObject *parent = nullptr);
~helperManager();

private:

Expand Down

0 comments on commit 500a49b

Please sign in to comment.