Refactoring the cleanup method so it is called after the stream/reader is closed. Fixes #65
This commit is contained in:
@@ -229,7 +229,6 @@ public class PollingXHR extends Polling {
|
|||||||
|
|
||||||
private void onSuccess() {
|
private void onSuccess() {
|
||||||
this.emit(EVENT_SUCCESS);
|
this.emit(EVENT_SUCCESS);
|
||||||
this.cleanup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onData(String data) {
|
private void onData(String data) {
|
||||||
@@ -244,7 +243,6 @@ public class PollingXHR extends Polling {
|
|||||||
|
|
||||||
private void onError(Exception err) {
|
private void onError(Exception err) {
|
||||||
this.emit(EVENT_ERROR, err);
|
this.emit(EVENT_ERROR, err);
|
||||||
this.cleanup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onRequestHeaders(Map<String, List<String>> headers) {
|
private void onRequestHeaders(Map<String, List<String>> headers) {
|
||||||
@@ -304,11 +302,9 @@ public class PollingXHR extends Polling {
|
|||||||
try {
|
try {
|
||||||
if (reader != null) reader.close();
|
if (reader != null) reader.close();
|
||||||
} catch (IOException e) {}
|
} catch (IOException e) {}
|
||||||
}
|
|
||||||
}
|
|
||||||
public void abort() {
|
|
||||||
this.cleanup();
|
this.cleanup();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static class Options {
|
public static class Options {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user