Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-12852

[iOS] App crash after taking 30+ photos (possible memory leak)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.4.1
    • Fix Version/s: None
    • Component/s: cordova-plugin-camera
    • Environment:

      Description

      To get that out of the way, I know there is already an issue for this bug (CB-11784), but since the author found a workaround using his own plugin (and the issue is on an older version of the plugin), I thought I would recreate it here and give more details on my situation.

      Taking photos is a really important part of our app and our clients usually need to take 100+ photos in one session. Unfortunately, the app seems to crash after 20-50 photos taken. Looking at the memory usage, I can clearly see the usage of "other processes" grow like Christopher McCabe noticed before (even on the latest version of the plugin).

      My team doesn't really want to use his custom plugin because it's not an official one and neither can we develop our own plugin since we are not Objective-C developers.

      Recreate the issue

      0. (Optional) Modify Christopher McCabe camera leak demo app to open the camera again after a successful photo (cancel a photo to get out of the loop)

      index.js (onDeviceReady)
      var button = document.getElementById('trigger-camera');
      button.addEventListener('click', function () {
          takePicture();
      }, false);
      
      function takePicture() {
          navigator.camera.getPicture(function () {
              navigator.camea.cleanup();
              takePicture();
          }, function () {
              console.log('failure');
          }
      }
      

      1. Build the app with the latest cordova-ios and camera-plugin
      2. Click on Trigger Camera
      3. Take photo (+ use photo)
      4. Go to 2. if 0. is not implemented and wait for the crash (around 30 photos in on iPhone 6)

      Questions

      Is there any workaround on this issue using the official plugin or do we have to use another plugin custom to fix it?

      Is this really an Apple related issue like Christopher McCabe suggests?

      Thanks in advance for your anwsers

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                QGangler Quentin Gangler
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: