Skip to content

Commit

Permalink
fix: tooltip crashed while application exit
Browse files Browse the repository at this point in the history
fix the clean job of blurnode

Issue: linuxdeepin/dtk#193
  • Loading branch information
FeiWang1119 committed Aug 19, 2024
1 parent c2a17b4 commit 40507bb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/private/dquickinwindowblur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ QSGNode *DQuickInWindowBlur::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDa
blurNode->setRenderCallback(onRender, this);
node->appendChildNode(blurNode);
node->setRenderCallback(updateBlurNodeTexture, blurNode);
connect(this, &QObject::destroyed, this, [node, blurNode](){
// fix callback crashed...
blurNode->setRenderCallback(nullptr, nullptr);
node->setRenderCallback(nullptr, nullptr);
});
}
#ifndef QT_NO_OPENGL
else if (ga == QSGRendererInterface::OpenGL
Expand All @@ -138,6 +143,11 @@ QSGNode *DQuickInWindowBlur::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDa
blurNode->setRenderCallback(onRender, this);
node->appendChildNode(blurNode);
node->setRenderCallback(updateBlurNodeTexture, blurNode);
connect(this, &QObject::destroyed, this, [node, blurNode](){
// fix callback crashed...
blurNode->setRenderCallback(nullptr, nullptr);
node->setRenderCallback(nullptr, nullptr);
});
}
#endif
else {
Expand Down

0 comments on commit 40507bb

Please sign in to comment.