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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:54:22+00:00 2026-05-11T18:54:22+00:00

I’m writing a simple ObjC2.0/Cocoa application, and I’m getting a crash.. Not being familiar

  • 0

I’m writing a simple ObjC2.0/Cocoa application, and I’m getting a crash.. Not being familiar with Cocoa or ObjC, I can’t work out why..

The code causing the problems is TableListCon.m

When I drag a folder onto the NSTableView, it calls addDirectoryToList – which recursively loops over all files contained in this directory, calling addFileToList on each.

When I drag a single file onto the tableview, it calls addFileToList directly. This works correctly, but in the Debugger Console it shows following message:

tvnamergui(2612) malloc: *** error for object 0x144ab0: double free
*** set a breakpoint in malloc_error_break to debug

Or, if I drag-and-drop a folder there is no such messages, and it drops directly to GDB, with the following backtrace:

(gdb) bt
#0  0x95cee688 in objc_msgSend ()
#1  0x921e2e4f in NSPopAutoreleasePool ()
#2  0x917b4b10 in NSCoreDragReceiveProc ()
#3  0x95f9e1b0 in DoDropMessage ()
#4  0x95f9dc11 in CoreDragMessageHandler ()
#5  0x960f0d21 in __CFMessagePortPerform ()
#6  0x961128e8 in CFRunLoopRunSpecific ()
#7  0x96112cd8 in CFRunLoopRunInMode ()
#8  0x924892c0 in RunCurrentEventLoopInMode ()
#9  0x92489012 in ReceiveNextEventCommon ()
#10 0x92488f4d in BlockUntilNextEventMatchingListInMode ()
#11 0x914e0d7d in _DPSNextEvent ()
#12 0x914e0630 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#13 0x914d966b in -[NSApplication run] ()
#14 0x914a68a4 in NSApplicationMain ()
#15 0x000022a0 in main (argc=1, argv=0xbffff74c) at /Users/dbr/Desktop/tvnamergui/main.m:13

Even stranger, if I drag a single file first I get the double free error, but then I can drop folders on with no crashes (and all works perfectly)

It always dies when [ArrayCon addObject:cfile]; is run (commenting this line stops the crash, but obviously breaks the functionality!)

Edit: Thanks to smorgan’s answer (Using NSZombieEnabled), I have a more useful error message:

*** -[CFArray release]: message sent to deallocated instance 0x155a70
  • 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-11T18:54:22+00:00Added an answer on May 11, 2026 at 6:54 pm

    While I can’t give a specific answer for your case, the best way to debug over-release crashes like this is to turn on NSZombieEnabled so you can easily see what object is being over-released.

    Edit: After looking around your project, I believe your problem is actually in the AppCon initializer. You are setting your member variable “theFiles” to an autoreleased array, and while you are using a retaining (well, copying) property, you aren’t setting it with property syntax (self.theFiles = …), so you are bypassing the auto-generated setter that would handle memory management correctly. When something tries to update that property later, it will try to release the old value which was, incorrectly, not retained. That’s most likely the array that you are seeing in the zombie logging.

    In short, change

    theFiles = [NSMutableArray arrayWithObjects:...];
    

    to

    self.theFiles = [NSMutableArray arrayWithObjects:...];
    

    and make sure to always use self.foo (or the explicit [self setFoo:] form) when assigning to your properties.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I need a function that will clean a strings' special characters. I do NOT

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.