cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "elio d'antoni (JIRA)" <>
Subject [jira] [Created] (CB-1751) Cordova 2.1.0 : custom plugin handle memory warning
Date Sat, 27 Oct 2012 06:41:12 GMT
elio d'antoni created CB-1751:

             Summary: Cordova 2.1.0 : custom plugin handle memory warning
                 Key: CB-1751
             Project: Apache Cordova
          Issue Type: New Feature
          Components: iOS
    Affects Versions: 2.1.0
         Environment: iOS version 5+
            Reporter: elio d'antoni
            Assignee: Shazron Abdullah
            Priority: Blocker

First of all I'm sorry if writing here is the wrong place but it's really hard to find some
technical help about cordova.

Straight to the problem : I have built a custom iOS plugin (basically an advanced version
of CDVCamera) When the plugin is called, using cordova.exec(..), my cameraController is presented
as modalController on top of mine CDVViewcontroller subclass, using the cameraController my
app receive some memory warnings that cause the unload of the CDVCordovaView.
Looking in to the iOS cordova lib code I noted that this scenario is faced by CDVViewcontroller
by checking if one of the plugin has pending operation and if yes the memory is not purged.

To achieve this the plugin(i.e CDVCamera) use the property hasPendingOperation
this property is set to true during the plugin lifecycle and to false once the operation are
So inspired by the CDVCamera code I've declared this property and set it to true during my
capture operations, but didn't work.
The problem,or at least one of the problems, is that didReceiveMemoryWarning is not called
on CDVViewController but is called in his subclass and even if I call [super didReceiveMemoryWarning]
the method of the superClass is not called,
in any case viewDidunload is called on the superClass causing the "freeze" of my app. 
So after this long story the question is how can I achieve the behavior of CDVCamera in a
custom plugin, that is , how avoid the unload of the CDVCordovaView during a memory warning.
Thanks in advance for any help / suggestion

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message