cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shazron Abdullah (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CB-7660) Cordova iOS File-Transfer download memory leaks
Date Thu, 02 Oct 2014 05:58:34 GMT

     [ https://issues.apache.org/jira/browse/CB-7660?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Shazron Abdullah updated CB-7660:
---------------------------------
    Description: 
File-Transfer memory leaks downloading files, no memory is released for each file downloaded,
finally i got "Memory Warning".

To test add a button and call "testDownload" function every time console confirmation message
is displayed ("DOWNLOADED OK")

{code}
function win(entry)
{
    console.log("DOWNLOADED OK");
}

function fail(error)
{
    console.log("ERROR!");
    console.log(error.code);
}

function testDownload
{
var url = "http://upload.wikimedia.org/wikipedia/commons/5/5b/Ultraviolet_image_of_the_Cygnus_Loop_Nebula_crop.jpg";

var filename = "filename.jpg";


var uri = encodeURI(url);
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) {
       fileSystem.root.getFile(filename, {create: true, exclusive: false}, function(fileEntry)
{
           var localPath = fileEntry.toURL();
           var ft = new FileTransfer();
           ft.download(uri,localPath,win,fail,false);

       },function(error){console.log("errore 1: " + error.code);});
    },function(error){console.log("errore 2: " + error.code);});

}
{code}

  was:
File-Transfer memory leaks downloading files, no memory is released for each file downloaded,
finally i got "Memory Warning".

To test add a button and call "testDownload" function every time console confirmation message
is displayed ("DOWNLOADED OK")

function win(entry)
{
    console.log("DOWNLOADED OK");
}

function fail(error)
{
    console.log("ERROR!");
    console.log(error.code);
}

function testDownload
{
var url = "http://upload.wikimedia.org/wikipedia/commons/5/5b/Ultraviolet_image_of_the_Cygnus_Loop_Nebula_crop.jpg";

var filename = "filename.jpg";


var uri = encodeURI(url);
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) {
       fileSystem.root.getFile(filename, {create: true, exclusive: false}, function(fileEntry)
{
           var localPath = fileEntry.toURL();
           var ft = new FileTransfer();
           ft.download(uri,localPath,win,fail,false);

       },function(error){console.log("errore 1: " + error.code);});
    },function(error){console.log("errore 2: " + error.code);});

}


> Cordova iOS File-Transfer download memory leaks
> -----------------------------------------------
>
>                 Key: CB-7660
>                 URL: https://issues.apache.org/jira/browse/CB-7660
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File Transfer
>    Affects Versions: 3.5.0
>         Environment: iOS 7.0.3 on iPad2 - Cordova 3.5
>            Reporter: Jordi Valls Carbonell
>
> File-Transfer memory leaks downloading files, no memory is released for each file downloaded,
finally i got "Memory Warning".
> To test add a button and call "testDownload" function every time console confirmation
message is displayed ("DOWNLOADED OK")
> {code}
> function win(entry)
> {
>     console.log("DOWNLOADED OK");
> }
> function fail(error)
> {
>     console.log("ERROR!");
>     console.log(error.code);
> }
> function testDownload
> {
> var url = "http://upload.wikimedia.org/wikipedia/commons/5/5b/Ultraviolet_image_of_the_Cygnus_Loop_Nebula_crop.jpg";
> var filename = "filename.jpg";
> var uri = encodeURI(url);
> window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) {
>        fileSystem.root.getFile(filename, {create: true, exclusive: false}, function(fileEntry)
{
>            var localPath = fileEntry.toURL();
>            var ft = new FileTransfer();
>            ft.download(uri,localPath,win,fail,false);
>        },function(error){console.log("errore 1: " + error.code);});
>     },function(error){console.log("errore 2: " + error.code);});
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message