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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:10:32+00:00 2026-05-30T02:10:32+00:00

When final testing my application in Instruments for leaks, I come across 2 odd

  • 0

When final testing my application in Instruments for leaks, I come across 2 odd leaks:

Leaked Object: _PFArray, #: 1 Address: 0x2a11c0 Size: 32 Bytes Responsible Library: CoreData Responsible Frame: newFetchedRowsForFetchPlan_MT

And

Leaked Object: Malloc 16 Bytes, #: 1 Address: 0x24d6b0 Size: 16 Bytes Responsible Library: CoreData Responsible Frame: newFetchedRowsForFetchPlan_MT

The stack traces for both leaks point to:

records = [[self.managedObjectContext executeFetchRequest:request error:&error] retain];

in a CoreData Fetch.

And

[self.window makeKeyAndVisible];

What are these leaks? I have never seen them before. They do not pop up when I build and Analyze. Does anybody have any suggestions?

Thanks!!

EDIT:

Here is the code around the records array. Records is just an NSarray declared in the .h.

  /*
 Fetch existing events.
 Create a fetch request; find the Event entity and assign it to the request; add a sort descriptor; then execute the fetch.
 */
marblebeingdragged=YES;
NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Child" inManagedObjectContext:_managedObjectContext];
[request setEntity:entity];

// Order the events by creation date, most recent first.
NSSortDescriptor *nameDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:NO];
NSSortDescriptor *prizeDescriptor = [[NSSortDescriptor alloc] initWithKey:@"prize" ascending:NO];
NSSortDescriptor *neededDescriptor = [[NSSortDescriptor alloc] initWithKey:@"marblesneeded" ascending:NO];
NSSortDescriptor *colorDescriptor = [[NSSortDescriptor alloc] initWithKey:@"color" ascending:NO];
NSSortDescriptor *reachedDiscriptor = [[NSSortDescriptor alloc] initWithKey:@"prizereached" ascending:NO];



NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:nameDescriptor,prizeDescriptor,neededDescriptor,colorDescriptor, nil];
[request setSortDescriptors:sortDescriptors];
[nameDescriptor release];
[colorDescriptor release];
[prizeDescriptor release];
[neededDescriptor release];
[reachedDiscriptor release];
[sortDescriptors release];

// Execute the fetch -- create a copy of the result.
NSError *error = nil;
records = [[self.managedObjectContext executeFetchRequest:request error:&error] retain];
  • 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-30T02:10:33+00:00Added an answer on May 30, 2026 at 2:10 am

    You need to release the “records” object. And you need to release it after you are done using it, NOT in dealloc method. Post more of your code. How did you define records? Post the entire core data code block please if you want any help.

    records = [[self.managedObjectContext executeFetchRequest:request error:&error] retain];
    //.... code using records
    [records release];
    

    Edit:

    Either use this

    records = [[self.managedObjectContext executeFetchRequest:request error:&error]]; // no retian
    

    OR this

    records = [[[self.managedObjectContext executeFetchRequest:request error:&error] retain] autorelease];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm on the final stretch of my first simple iPhone application. I'm building an
I am testing simple alarm application. In firstactivity I set alarm with ringtone which
I'm finishing my Core Data app ans I started my final testing. Everyfing works
I am testing my application in the Python Shell on Symbian S60 Platform. Functionally,
I've been testing sending and receiving broadcasts in my application but I have a
Final question for the night. And apologies for the complete noobness of this. I
Can final keyword be used for a method?
The final images produced by compliers contain both bin file and extended loader format
My final goal is to write the program which can run on the Unix
While in the final throws of upgrading MS-SQL Server 2005 Express Edition to MS-SQL

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.