Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

fix: 进程关闭流程优化#497

Merged
JerryQAQ-233 merged 9 commits into
Class-Widgets:mainfrom
baiyao105:Fix_13
Mar 8, 2025
Merged

fix: 进程关闭流程优化#497
JerryQAQ-233 merged 9 commits into
Class-Widgets:mainfrom
baiyao105:Fix_13

Conversation

@baiyao105

@baiyao105 baiyao105 commented Mar 7, 2025

Copy link
Copy Markdown
Member

总览

线程优化

  • main.py: add.等待线程完全终止
  • network_thread.pyadd.运行状态_running
  • 退出时进行子对象清理
  • 顺便兼容了下ctrl+c(

测试

  • 关机报错.?(找人测试)
    • 也许能解决这种玄学问题(
  • taskkill非强制关闭(诶,又不行了,,)
  • 退出程序控件

@baiyao105 baiyao105 changed the title fix: 确保在停止线程时释放内存 fix: 修复部分情况下关机报错 Mar 7, 2025
@baiyao105

Copy link
Copy Markdown
Member Author

image

"接下来":我走了~

@baiyao105 baiyao105 changed the title fix: 修复部分情况下关机报错 fix: 进程关闭流程优化 Mar 7, 2025
@baiyao105 baiyao105 marked this pull request as ready for review March 7, 2025 13:35
- 添加清理资源方法
- 防止多次销毁
- 安全终止线程
@baiyao105 baiyao105 marked this pull request as draft March 8, 2025 03:04
- 还是收不到taskkill的信号,再不行就只能用暴力的方法了
@baiyao105 baiyao105 marked this pull request as ready for review March 8, 2025 05:11
@baiyao105

Copy link
Copy Markdown
Member Author

我认为这样应该可以正常关机了,taskkill不管了,/f也不是不行(

- 其实没有必要了,,
- 防止出现UnboundLocalError
@JerryQAQ-233 JerryQAQ-233 merged commit 6085d34 into Class-Widgets:main Mar 8, 2025

@IsHPDuwu IsHPDuwu left a comment

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.

?奇妙小缩进?

Comment thread main.py
for child in self.findChildren(QObject):
child.deleteLater()
super().closeEvent(event)
self.deleteLater()

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.

哥你确定你缩进没错?

@baiyao105 baiyao105 Apr 26, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

没有明显影响,我记得swx说删了(?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

(其实我也不指望放这里的closeEvent用处)

pizeroLOL pushed a commit to pizeroLOL/Class-Widgets that referenced this pull request Aug 10, 2025
## 总览
### 线程优化
- `main.py`: add.等待线程完全终止
- `network_thread.py`add.运行状态`_running`
- 退出时进行子对象清理
- 顺便兼容了下ctrl+c(
----
### 测试
- [ ] 关机报错.?(找人测试)
  - 也许能解决这种玄学问题(
- [ ] `taskkill`非强制关闭(诶,又不行了,,)
- [X] `退出程序`控件
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants