We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a11c50a commit 924c183Copy full SHA for 924c183
android/app/src/main/java/betaflight/configurator/plugin/SocketPlugin.java
@@ -181,8 +181,16 @@ public void disconnect(final PluginCall call) {
181
Log.d(TAG, "Disconnected successfully");
182
} catch (Exception e) {
183
state.set(ConnectionState.ERROR);
184
+ // Ensure cleanup completes even on error
185
+ try {
186
+ closeResourcesInternal();
187
+ } catch (Exception ce) {
188
+ Log.e(TAG, "Cleanup error during disconnect", ce);
189
+ }
190
call.reject("Disconnect failed: " + e.getMessage());
191
Log.e(TAG, "Disconnect failed", e);
192
+ // Reset to a clean disconnected state after handling error
193
+ state.set(ConnectionState.DISCONNECTED);
194
} finally {
195
socketLock.unlock();
196
call.setKeepAlive(false);
0 commit comments