Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-26800

iOS:TiBlob.imageAsCompressed leaks memory

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: Release 8.0.0, Release 7.5.1
    • Fix Version/s: Release 7.5.2
    • Component/s: None
    • Labels:
    • Environment:

      SDK 8, 7.x

      Description

      The TiBlob.imageAsCompressed method leaks memory as it's not initialising the blob with the page context. For that reason, is not deallocated once it's JS proxy is garbage collected.
      The following code (TiBlob.m, line 387,also in TitaniumKit) should be changed:

      return [[[TiBlob alloc] initWithData:UIImageJPEGRepresentation(image, compressionQuality) mimetype:@"image/jpeg"] autorelease];
      

      into this:

      return [[[TiBlob alloc] _initWithPageContext:self.pageContext andData:UIImageJPEGRepresentation(image, compressionQuality) mimetype:@"image/jpeg"] autorelease];
      

      I can provide a PR if needed.

        Attachments

          Activity

            People

            • Assignee:
              vijaysingh Vijay Singh
              Reporter:
              rlustemberg Richard Lustemberg
              Reviewer:
              Lokesh Choudhary
              Tester:
              Keerthi Mahalingam (Inactive)
            • Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-21016
                  Sync status:
                  PENDING
                  Last received:
                  Last sent:

                  Git Source Code