Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tooltip crashed while application exit #381

Closed
wants to merge 1 commit into from

Conversation

FeiWang1119
Copy link
Contributor

fix the clean job of blurnode

Issue: linuxdeepin/dtk#193

@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

关键摘要:

  • connect函数中使用Lambda表达式时,应该检查nodeblurNode是否为空,以避免在对象销毁时执行空指针。
  • 应该添加错误处理或日志记录,以便在setRenderCallback中发生错误时能够记录相关信息。

是否建议立即修改:

deepin-ci-robot added a commit to linuxdeepin/dtk6declarative that referenced this pull request Aug 19, 2024
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#381
@deepin-bot
Copy link
Contributor

deepin-bot bot commented Aug 19, 2024

Doc Check bot
🟢 Document Coverage Check Passed!

@kegechen
Copy link
Contributor

/approve

@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: FeiWang1119, kegechen

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kegechen
Copy link
Contributor

@@ -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](){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

正常情况下, quickitem销毁了, node应该也被销毁把, 不需要去重置这个callback,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node可能会比item晚一点销毁,因为渲染可能是在一个新线程里,如果在渲染中销毁了item,它的node是不会立即销毁的。但是这里也不应该这样改,应该在 node 调用 callback之前检查 setRenderCallback中给出来的第二个参数。

@@ -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](){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node可能会比item晚一点销毁,因为渲染可能是在一个新线程里,如果在渲染中销毁了item,它的node是不会立即销毁的。但是这里也不应该这样改,应该在 node 调用 callback之前检查 setRenderCallback中给出来的第二个参数。

@kegechen
Copy link
Contributor

暂时close,不是这里的问题 @FeiWang1119

@kegechen kegechen closed this Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants