Fix dangerous connection teardown ordering leading to native crashes in jnienet

This commit is contained in:
Cameron Gutman 2016-04-04 01:18:14 -04:00
parent a907dd0084
commit 246fb69050

View File

@ -81,21 +81,22 @@ public class NvConnection {
public void stop() public void stop()
{ {
if (videoStream != null) { if (inputStream != null) {
videoStream.abort(); inputStream.abort();
inputStream = null;
} }
if (audioStream != null) { if (audioStream != null) {
audioStream.abort(); audioStream.abort();
} }
if (videoStream != null) {
videoStream.abort();
}
if (controlStream != null) { if (controlStream != null) {
controlStream.abort(); controlStream.abort();
} }
if (inputStream != null) {
inputStream.abort();
inputStream = null;
}
} }
private boolean startApp() throws XmlPullParserException, IOException private boolean startApp() throws XmlPullParserException, IOException