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 6657973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:50:11+00:00 2026-05-26T01:50:11+00:00

Instruments is showing that i get a memory leak right there: -(id) copyWithZone: (NSZone

  • 0

Instruments is showing that i get a memory leak right there:

-(id) copyWithZone: (NSZone *) zone
{ 
    Layer *copy = [[Layer allocWithZone:zone]init];
    NSData *imageData = [[NSData alloc]initWithData:_image];
    copy.image = imageData;
    [imageData release];

    return copy;
}

The image property is declared as it follows:

@property (nonatomic, retain) NSData *image;

Here is a screenshot of instruments, to prove that i am not lying.

Image snapshot

Anyone see a problem in there?

  • 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-05-26T01:50:12+00:00Added an answer on May 26, 2026 at 1:50 am

    Here is how we solved it, following the instructions given here.

    -(id) copyWithZone: (NSZone *) zone
    {
        Layer *copy = [[Layer allocWithZone:zone]init];
        copy->_image=nil;
        [copy setImage:[self image]];
        return copy;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

does an entry in Instruments leaked block during application running imply memory leak? That
Instruments is pointing out that this is a memory leak, however I'm unsure how
Instruments tells that there are misaligned images which are animated by core animation. What
Instruments tells me there's a mem leak in this code, but I can't seem
Using Instruments, I keep on getting pointed to a memory leak with a UIImage.
I tracked down a memory leak with instruments. I always end up with the
my iphone application crash after raising 4 warnings of low memory, instruments is showing
Using Instruments on the device it detects a 3.50 KB memory leak using Apple's
Instruments shows me that I have a leak in the following code: CGContextMoveToPoint(c, startPoint.x,
I'm getting an instruments Memory Leak with this iPhone 3.0 SDK code. I'm using

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.