From a8c460e715c46e403d6998cb63fb9e51c76236ed Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 7 Mar 2016 12:51:48 -0800 Subject: [PATCH] Close the ENet connection only after threads that might be using it have been killed --- .../limelight/nvstream/control/ControlStream.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/moonlight-common/src/com/limelight/nvstream/control/ControlStream.java b/moonlight-common/src/com/limelight/nvstream/control/ControlStream.java index db8d56ee..ffe33c50 100644 --- a/moonlight-common/src/com/limelight/nvstream/control/ControlStream.java +++ b/moonlight-common/src/com/limelight/nvstream/control/ControlStream.java @@ -242,12 +242,6 @@ public class ControlStream implements ConnectionStatusListener, InputPacketSende } catch (IOException e) {} } - if (enetConnection != null) { - try { - enetConnection.close(); - } catch (IOException e) {} - } - if (lossStatsThread != null) { lossStatsThread.interrupt(); @@ -263,6 +257,12 @@ public class ControlStream implements ConnectionStatusListener, InputPacketSende resyncThread.join(); } catch (InterruptedException e) {} } + + if (enetConnection != null) { + try { + enetConnection.close(); + } catch (IOException e) {} + } } public void start() throws IOException