Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion src/com/androidquery/callback/AbstractAjaxCallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,31 @@ private void clear(){
transformer = null;
ah = null;
act = null;

callback = null;
targetFile = null;
cacheDir = null;
cookies = null;
headers = null;
params = null;
proxy = null;
networkUrl = null;

abort = false;
blocked = false;
completed = false;
fileCache = false;
memCache = false;
reauth = false;
refresh = false;

method = Constants.METHOD_DETECT;
policy = Constants.CACHE_DEFAULT;
lastStatus = 200;
expire = 0;
retry = 0;
timeout = 0;
uiCallback = true;
}

/**
Expand Down Expand Up @@ -1183,6 +1208,11 @@ private void filePut(){
}
}

}else if(status.getFile() != null && status.getSource() == AjaxStatus.NETWORK && status.getInvalid()){
File file = status.getFile();
if (file.exists()) {
file.delete();
}
}
}catch(Exception e){
AQUtility.debug(e);
Expand Down Expand Up @@ -1663,7 +1693,15 @@ private void httpDo(HttpUriRequest hr, String url, Map<String, String> headers,
file = null;
}
}


}catch(IOException e){
if (file != null) {
AQUtility.close(os);
os = null;
file.delete();
}
throw e;

}finally{
AQUtility.close(is);
AQUtility.close(os);
Expand Down