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
Fix App does not automatically reconnect to HU after changing language #1590
Conversation
@zhouxin627 Thanks for the PR. Have you determined if this PR or something similar is needed on Java_Suite? |
Hi @joeljfischer, I think there is no need to modify Java_Suite because it can work well. |
A few questions:
This doesn't seem to be true, only the lifecycle manager has a proxy object.
Where does this happen. |
When the head unit sends data to the phone, the session will transfer data to Proxy, and this
The function( The proxy object is owed by |
Hello @zhouxin627, are you considering this bug no longer as needing a fix? Are you planning on re-opening this PR? |
Hi @joeljfischer, yes, I want to re-opening this PR. It was closed automatically when I revert |
@zhouxin627 can you please confirm if this PR is now ready for Livio's review? |
@theresalech Hi, this PR is now ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one small comment for you to alter!
Co-Authored-By: Joel Fischer <joeljfischer@gmail.com>
Fixes #1532
This PR is ready for review.
Risk
This PR makes no API changes.
Testing Plan
Covered by Unit tests.
Summary
Reason
ioStreamThread
andlifecycleThread
) have Proxy objectUnregisterApp
is invokedlifecycleThread
'sstopManager
is invokedProxy = nil
and then Proxy's reference count will reduce to0
0
,Proxy'sdealloc
method will be invokedNormal case:
5.1.1 Proxy's
dealloc
is invoked in thelifecycleThread
5.1.2 set
ioStreamThread
's cancel flag true5.1.3
ioStreamThread
exit5.1.4 close Session
5.1.5
ioStreamThread = nil
5.1.6 create new session successfully
Abnormal case:
5.2.1 Proxy's
dealloc
is invoked in theioStreamThread
5.2.2 set
ioStreamThread
's cancel falg true5.2.3
ioStreamThread = nil
5.2.4
ioStreamThread
exit faild5.2.5 create new session failed
Solution
Avoid
ioStreamThread
do expensive operations, so move the methods in thedealloc
to the new method ofdisconnectSession
, before setProxy = nil
, executedisconnectSession
.ioStreamThread
andlifecycleThread
) have Proxy objectUnregisterApp
is invokedlifecycleThread
'sstopManager
is invokeddisconnectSession
method in thelifecycleThread
ioStreamThread
's cancel flag trueioStreamThread
exitioStreamThread = nil
Proxy = nil
and then Proxy's reference count will reduce to0
0
,Proxy'sdealloc
method will be invokedCLA