Skip to content

fix: tooltip crashed while application exit - #381

Closed
FeiWang1119 wants to merge 1 commit into
linuxdeepin:dev/animationfrom
FeiWang1119:animation
Closed

fix: tooltip crashed while application exit#381
FeiWang1119 wants to merge 1 commit into
linuxdeepin:dev/animationfrom
FeiWang1119:animation

Conversation

@FeiWang1119

Copy link
Copy Markdown

fix the clean job of blurnode

Issue: linuxdeepin/dtk#193

@deepin-ci-robot

Copy link
Copy Markdown
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

deepin-bot Bot commented Aug 19, 2024

Copy link
Copy Markdown
Contributor

Doc Check bot
🟢 Document Coverage Check Passed!

@kegechen

Copy link
Copy Markdown
Contributor

/approve

@deepin-ci-robot

Copy link
Copy Markdown
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.

Details 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
Copy Markdown
Contributor

blurNode->setRenderCallback(onRender, this);
node->appendChildNode(blurNode);
node->setRenderCallback(updateBlurNodeTexture, blurNode);
connect(this, &QObject::destroyed, this, [node, blurNode](){

Copy link
Copy Markdown
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
Copy Markdown
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中给出来的第二个参数。

blurNode->setRenderCallback(onRender, this);
node->appendChildNode(blurNode);
node->setRenderCallback(updateBlurNodeTexture, blurNode);
connect(this, &QObject::destroyed, this, [node, blurNode](){

Copy link
Copy Markdown
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
Copy Markdown
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