Solve the problem that the bound object has been destroyed during callback for TcpClient #489
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
之前回复过大神,我现在有一些想法,关于TcpClient销毁,但是回调仍然依赖于这个对象或者子对象,我这里在回调部分,全都使用了智能指针,并且将Connector的构造函数隐藏,只能使用Connector::create来创造智能指针对象,避免使用者,在使用过程中,在栈中构造Connector,在我的工程代码环境中测试过,没有出现之前提到的由于对象销毁,回调时依赖于无效的指针的问题,大神可以看看,这样改行不行