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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:00:27+00:00 2026-05-26T09:00:27+00:00

I have spent some time debugging a weird issue with ARC and custom dealloc

  • 0

I have spent some time debugging a weird issue with ARC and custom dealloc functions.

  1. I’m subclassing NSOperation class
  2. I set completion block for this operation
  3. The operation is referenced by a strong property of very flat object (no methods, automatic ivars, two strong properties) lets call this object DataRequest
  4. following all guidelines the completion block uses only weak references to local objects (including the operation itself)
  5. neither compiler nor analyzer generate any issues
  6. DataRequest holds the ONLY reference to the operation I generate and is destroyed in the operation completion block. It’s ALWAYS destroyed (its dealloc always executed)
  7. My operation has a custom dealloc. I have only a single NSLog call in it.

… and the issue is:

If I run this under in debugger, the breakpoint in the dealloc is never hit, the log message never appears. Primarily I thought the operation was leaking.

If I run this in instruments, all is fine, the system console prints the message and Allocations instrument reports the operation being freed from the proper stack snapshot including the custom dealloc. No leaks detected.

I’m 100% sure I use the same compiler settings for debugging and for profiling.

The most confusing thing at the end: If I create a custom version of [DataRequest dealloc] and I put self.operation = nil; to it – all works fine even from the debugger.

Does anybody have some hints what compiler linker options to try to see some difference? can this be bug in Apple tools (all of us were in the position blaming a big fish for our own errors, right?)

… and yes I have tried with GDB and LLDB. Result was the same – what might indicate something.

I have tried to create a minimalistic sample but it just worked (indeed) 😉

Thanks

  • 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-26T09:00:28+00:00Added an answer on May 26, 2026 at 9:00 am

    Do you have NSZombiesEnabled? We had the same issue and “solved” it by disabling NSZombies.

    “Product” -> “Scheme” -> “Edit scheme” -> “Diagnostics” -> Uncheck “Enable Zombie Objects”

    I’m not sure why dealloc isn’t called when NSZombies are enabled (I’m pretty sure it was called before ARC).

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

Sidebar

Related Questions

I have spent some time now to solve a problem for which i have
I have asked this question before - but I have spent some time thinking
This has probably been answered before, but I have spent some time looking and
I have spent quite some time making a function and the last 15-20 minutes
I have spent some time learning what are Java Native methods and that they
I have spent some time trying to create a child window of an existing
I have spent some time researching Android's ability to communicate with bluetooth devices that
I have spent some time learning how to do rewrites and have had success
I have spent lot of time doing research on VIM. I am Windows guy
I have spent too much time on this problem and am beginning to think

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.