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

[bug]关闭窗口后,子线程不能同时退出 #11

Open
FoxonFires opened this issue Dec 5, 2024 · 0 comments
Open

[bug]关闭窗口后,子线程不能同时退出 #11

FoxonFires opened this issue Dec 5, 2024 · 0 comments

Comments

@FoxonFires
Copy link

FoxonFires commented Dec 5, 2024

由于在move_tracker.py中创建了多线程,但未设置线程守护
经测试创建线程时可修改为:

        # 开启新线程
        self.render_timer = threading.Thread(target=self.render)
        self.render_timer.setDaemon(True)        #设置线程守护
        self.render_timer.start()
```
可在关闭窗口后,自动退出子线程

PS:原代码中ScrollTracker的析构函数似乎没有被调用:无法命中析构函数内部断点,也无法打印log。另外经测试,join()无法等待死循环while true。需要额外设置flag终止死循环
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

No branches or pull requests

1 participant