Refactoring the cleanup method so it is called after the stream/reader is closed. Fixes #65

This commit is contained in:
wzurita
2016-08-29 23:50:01 +02:00
parent ac9df7e106
commit 59586f7609

View File

@@ -229,7 +229,6 @@ public class PollingXHR extends Polling {
private void onSuccess() {
this.emit(EVENT_SUCCESS);
this.cleanup();
}
private void onData(String data) {
@@ -244,7 +243,6 @@ public class PollingXHR extends Polling {
private void onError(Exception err) {
this.emit(EVENT_ERROR, err);
this.cleanup();
}
private void onRequestHeaders(Map<String, List<String>> headers) {
@@ -304,11 +302,9 @@ public class PollingXHR extends Polling {
try {
if (reader != null) reader.close();
} catch (IOException e) {}
}
}
public void abort() {
this.cleanup();
}
}
public static class Options {