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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:33:10+00:00 2026-05-24T13:33:10+00:00

I have a weird issue that comes up while releasing an object. In the

  • 0

I have a weird issue that comes up while releasing an object. In the object’s dealloc method I am releasing another (sub) object. When this sub object is released I get an EXC_BAD_ACCESS error. I am pretty sure the sub-object is a valid pointer right before I call release on it.

This is how I’ve confirmed the weirdness – I set a break point inside the dealloc method, right before the release of the sub-object, and it is allocated! I can send it messages and it responds correctly. Another weird bug is that, if NSZombieEnabled is set to YES, I dont get an error at all, not even NSZombie’s usual error that says I’ve sent a message to a deallocated object, the code runs properly.

Does anybody have any idea how to solve this?

Thanks in advance!


* EDIT 1 *

I’ve found out that if I place the [super dealloc] in the end of the dealloc, it crashes, but if I place it at start, it won’t. I’ve had something similar before, only the other way – app crashed if I [super dealloc] in start of my dealloc, and didn’t at the end.

Why does it make a difference and when should you use what?


* EDIT 2 *

Scratch Edit #1! It doesn’t work either way.

  • 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-24T13:33:12+00:00Added an answer on May 24, 2026 at 1:33 pm

    Do your dealloc routine happen to look like this:

    - (void)dealloc
    {
       [super dealloc];
       [otherObject release];
    }
    

    if so, change the order. If you call [super dealloc], your object gets vanished from memory, trying to acces otherObject later will cause you to access non-allocated memory -> EXC_BAD_ACCESS.

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

Sidebar

Related Questions

I have a weird issue that only seems to be affecting IE 7. The
I have a weird issue using polymorphism. I have a base class that implements
Having a weird issue. I'm new to Macs and have a windows VM that
I have a very weird issue. I have a UserControl that has some controls
I have a weird issue that only seems to show itself on IE 8
I have this weird issue with special characters. In JSP, I am using field
I have this weird issue in Magento when someone places an order using PayPal
We have a semi-weird issue for our site. Consistently, from 1 anonymous* user the
I have a weird date rounding problem that hopefully someone can solve. My client
I have some extremely weird behavior that seems to result in silent exceptions. How

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.