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

  • Home
  • SEARCH
  • 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 6648291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:38:18+00:00 2026-05-26T00:38:18+00:00

This code down below works as expected, cleans things up without Zombies. The class

  • 0

This code down below works as expected, cleans things up without Zombies. The class in which this method exists, is the owner of the Nodes, which are being released, yet, upon “Analyze” the following 2 issues show up.

If possible, could you help me understand why?

enter image description here

- (void) dealloc {  
    NSLog(@"Releasing [Doubly Linked List] .. ");

    Node *thisNode = [self firstNode]; 
    Node *nextNode = [thisNode next];

    while (nextNode != nil) {

        // If "Next node" is not nil, it means that
        //   "previous node" can now be released

        NSLog(@"    - releasing node \"%c\"", [[nextNode previous] charData]);
        [[nextNode previous] release];

        nextNode = [nextNode next];
    }

    [[self lastNode] release];
    [super dealloc];
}
  • 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-26T00:38:19+00:00Added an answer on May 26, 2026 at 12:38 am

    Click on the icon on the left of the message, it will show the path through the code that produces the error.

    You are releasing something, [nextNode previous] that you do not own. In particular you did not alloc or retain it nor obtain it from a method that begins with new or copy so you do not have ownership of it and should not release it.

    It is also very uncommon to release something not in your class, [[nextNode previous] release].

    Now: [[self lastNode] release];

    As above you did not obtain an ownership on the object you are releasing.

    If lastNode is a property with retain you are subverting the setter and when later a value is assigned to lastNode via the setter there will be an extra release on the object and probably a crash. If it is not a property again this it very non-standard to release something that is returned by a method call.

    Any releases with code of this form [[self lastNode] release] is non-standard and if be avoided there will be fewer ownership (retain/release) problems.

    You will save a lot of time and grief by studying the Apple memory management documentation.

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

Sidebar

Related Questions

The jQuery code below works such that on clicking a link (class address), it
Does anyone actually think this is a good reason to Dumb down your code?
Well, I have this bit of code that is slowing down the program hugely
This code works (C# 3) double d; if(d == (double)(int)d) ...; Is there a
This code always works, even in different browsers: function fooCheck() { alert(internalFoo()); // We
This code produces a FileNotFoundException, but ultimately runs without issue: void ReadXml() { XmlSerializer
I have the below SQL which works just fine: SELECT Message, CreateDate, AccountId, AlertTypeId
In my code below, case #1 works correctly. The advice-area div stays to the
basically I'm trying to get #toggle_box to slide down using Jquery, the code below
Below is a simple method I wrote (extremely simplified down so I hope it

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.