diff options
author | Joey Grover <joeygrover@gmail.com> | 2016-10-27 16:50:42 -0400 |
---|---|---|
committer | Joey Grover <joeygrover@gmail.com> | 2016-10-27 16:50:42 -0400 |
commit | 364b4aaa374d0c3e8ad78cbd1f4be33eee789e82 (patch) | |
tree | a85b8830ff324c408b861420269965eb92984e90 | |
parent | ecacf239f8e2930be9f7a9640929327c8511bbd7 (diff) | |
download | sdl_android-bugfix/issue_355.tar.gz |
Set the HttpRequestTask callback to null after a single callbackbugfix/issue_355
-rw-r--r-- | sdl_android_lib/src/com/smartdevicelink/util/HttpRequestTask.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sdl_android_lib/src/com/smartdevicelink/util/HttpRequestTask.java b/sdl_android_lib/src/com/smartdevicelink/util/HttpRequestTask.java index f5f56ece4..3d26b2994 100644 --- a/sdl_android_lib/src/com/smartdevicelink/util/HttpRequestTask.java +++ b/sdl_android_lib/src/com/smartdevicelink/util/HttpRequestTask.java @@ -69,6 +69,7 @@ public class HttpRequestTask extends AsyncTask<String, String, String> { Log.e(TAG, "Can't process request, param error"); if(cb!=null){ cb.httpFailure(-1); + cb = null; } return "Error"; } @@ -98,6 +99,7 @@ public class HttpRequestTask extends AsyncTask<String, String, String> { // Nothing to do. if(cb!=null){ cb.httpCallComplete(null); + cb = null; } return null; } @@ -110,6 +112,7 @@ public class HttpRequestTask extends AsyncTask<String, String, String> { // Stream was empty. No point in parsing. if(cb!=null){ cb.httpCallComplete(null); + cb = null; } return null; } @@ -119,17 +122,19 @@ public class HttpRequestTask extends AsyncTask<String, String, String> { //send to post execute if(cb!=null){ cb.httpCallComplete(response); + cb = null; } return response; }else{ if(cb!=null){ cb.httpFailure(responseCode); + cb = null; } Log.e(TAG, "Failed to download file - " + responseCode); return null; } - + } catch (IOException e) { e.printStackTrace(); } |