File tree Expand file tree Collapse file tree 1 file changed +18
-16
lines changed
android/app/src/main/java/betaflight/configurator/plugin Expand file tree Collapse file tree 1 file changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -135,22 +135,24 @@ public void disconnect(PluginCall call) {
135135 * Helper method to close all resources and clean up state
136136 */
137137 private void closeResources () {
138- try {
139- if (reader != null ) {
140- reader .close ();
141- reader = null ;
142- }
143- if (writer != null ) {
144- writer .close ();
145- writer = null ;
146- }
147- if (socket != null ) {
148- socket .close ();
149- socket = null ;
138+ try {
139+ if (reader != null ) {
140+ reader .close ();
141+ reader = null ;
142+ }
143+ if (writer != null ) {
144+ writer .close ();
145+ writer = null ;
146+ }
147+ if (socket != null ) {
148+ socket .close ();
149+ socket = null ;
150+ }
151+ } catch (IOException e ) {
152+ // Log but continue cleanup
153+ isConnected = false ;
154+ getContext ().getActivity ().runOnUiThread (() ->
155+ Log .e ("SocketPlugin" , "Error closing resources" , e ));
150156 }
151- } catch (IOException e ) {
152- // Log but continue cleanup
153- getContext ().getActivity ().runOnUiThread (() ->
154- Log .e ("SocketPlugin" , "Error closing resources" , e ));
155157 }
156158}
You can’t perform that action at this time.
0 commit comments