Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8375437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:10:39+00:00 2026-06-09T15:10:39+00:00

I am having memory warning with my app then it crashes. The error, I

  • 0

I am having memory warning with my app then it crashes. The error, I think is on my draw-on-touch feature, because when I tried to run it with the alloc instrument the memory starts increasing when i keep on moving my finger on the screen.

Here’s my code.

    touchSwiped = YES;

    UITouch *touch = [touches anyObject];

    previousPoint2 = previousPoint1;
    previousPoint1 = currentTouch;
    currentTouch = [touch locationInView:self.view];

    CGPoint mid1 = midPoint(previousPoint2, previousPoint1); 
    CGPoint mid2 = midPoint(currentTouch, previousPoint1);

    UIGraphicsBeginImageContext(CGSizeMake(480 , 320));
    [drawView.image drawInRect:CGRectMake(0, 0, 480,320)];  

    CGContextRef context = UIGraphicsGetCurrentContext();    

    CGContextSetLineCap(context,kCGLineCapRound);
    CGContextSetLineWidth(context, inkWidth);
    CGContextSetBlendMode(context, blendMode);
    CGContextSetRGBStrokeColor(context,redColor, greenColor, blueColor, 1);
    CGContextBeginPath(context);
    CGContextMoveToPoint(context, mid1.x, mid1.y);
    CGContextAddQuadCurveToPoint(context, previousPoint1.x, previousPoint1.y, mid2.x, mid2.y);
    CGContextStrokePath(context);

    drawView.image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsGetCurrentContext();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:10:40+00:00Added an answer on June 9, 2026 at 3:10 pm

    I did what Ohr’s said on his comment and it worked for me.

    I released the CGContextRef like this CGContextRelease(context);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble with UIImage memory management. (iphone) my app gets memory warning when
I having a warning when i analyze my code for memory leak from xcode.
As we all know that iPod touch is having less memory than iPhone, but
My application is having memory problems, including copying lots of strings about, using the
I'm having memory issues while reading video frames from an existing video chosen from
I'm fairly certain I'm having memory leaks using KO version 2.0. I have an
I'm having a memory problem related to UIImageView. After adding this view to my
I believe I am having a memory issue using numpy arrays. The following code
My Audio Unit analysis project is having some memory issues, whereby each time an
I'm having trouble with memory in a j2me application. (see another question ) I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.