cleanup file and request references

This commit is contained in:
j 2016-09-19 23:43:43 +02:00
parent 0fccc86473
commit 7607afd0c9
2 changed files with 5 additions and 3 deletions

View file

@ -57,6 +57,7 @@ pandora.chunkupload = function(options) {
response: response,
responseText: that.responseText
});
options.file = null;
options = null;
file = null;
request = null
@ -69,7 +70,7 @@ pandora.chunkupload = function(options) {
request = new XMLHttpRequest();
request.addEventListener('load', function (evt) {
var response = {};
that.responseText = evt.target.responseText;
that.responseText = '' + evt.target.responseText;
try {
response = JSON.parse(evt.target.responseText);
} catch(e) {
@ -99,7 +100,7 @@ pandora.chunkupload = function(options) {
request.addEventListener('error', function (evt) {
that.status = 'upload failed';
that.progress = -1;
that.responseText = evt.target.responseText;
that.responseText = '' + evt.target.responseText;
done();
}, false);
request.addEventListener('abort', function (evt) {
@ -149,7 +150,7 @@ pandora.chunkupload = function(options) {
request = new XMLHttpRequest();
request.addEventListener('load', function (evt) {
var response;
that.responseText = evt.target.responseText;
that.responseText = '' + evt.target.responseText;
try {
response = JSON.parse(evt.target.responseText);
} catch(e) {

View file

@ -2692,6 +2692,7 @@ pandora.uploadQueue = (function() {
queue[index].data.ended = +new Date();
queue[index].data.status = data.progress == 1 ? 'queued' : 'failed';
queue[index].data.progress = data.progress;
queue[index].file = null;
upload();
},
progress: function(data) {