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

停止机制不完整,用户无法在MQTT线程停止时收到通知或等待线程停止 #41

Open
easyeagel opened this issue Jun 2, 2020 · 1 comment

Comments

@easyeagel
Copy link

如题,无法收到通知或等待停止时,会遇到无法正常释放MQTTClient对象,如果这个对象是malloc创建的话,将无法合适地free这个对象。
在stop之后不能释放,因为MQTT线程还在使用该对象,当MQTT线程退出时,其它线程无法得知。目前只能使用线程钩子来实现这个通知。
正确的退出流程应该有一个通知回调,或在stop方法里等待线程退出。

@Lawlieta
Copy link
Contributor

Lawlieta commented Jun 3, 2020

是,目前 paho-mqtt 中没有很好的处理的 MQTT 客户端关闭问题,欢迎提交相关 PR

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

2 participants