Re: Random crash
Re: Random crash
- Subject: Re: Random crash
- From: publiclook <email@hidden>
- Date: Thu, 7 Aug 2003 22:19:44 -0400
On Thursday, August 7, 2003, at 09:16 PM, Tom Sutcliffe wrote:
Check out NSDebug.h. Specifically, turn on NSZombieEnabled. I thought
autorelease was the work of the devil before I started using this,
once it's turned on you it is a great help. Specifically, being able
to set breakpoints whenever a method is called on a deallocated object
instead of the thing just crashing. I may be stating the obvious but
being new to gdb I've only just worked out how to get a break point
whenever an exception occurs (you get it for free in java...)!
I am glad that you have found a comfortable way to work, but really,
how hard is it to follow the Cocoa's simple conventions and then not
have "autorelease" problems ? It is a rhetorical question, and I don't
mean to pick on you specifically. A am just frustrated that something
that seems so simple, intuitive, and excellently implemented is causing
so many people so many problems. It is not as if NeXT or Apple
invented reference counting. There are implementations and technical
descriptions dating back to the 1950s, and there were prominent
reference counting systems deployed before Openstep adopted the
convention. Even Microsoft uses reference counting with COM and DCOM
(for many of the same reasons NeXT chose it) and with "smart pointers"
and with the CString MFC class. Many C libraries from the 1980s used
reference counting to handle the problem of freeing and knowing when to
free non-heap resources such as semaphores, file descriptors, database
query results, mach messages, shared memory, DMA buffers, etc. Anyone
with any non-trivial experience using C or C++ libraries is familiar
with the problem of who is responsible for releasing resources obtain
through the library. Cocoa's simple and consistent conventions should
seem like heaven and certainly not the work of the devil. Now cursing
Java when it pauses an animation that is being recorded to disk because
it chose that moment to garbage collect the thousands of temporary
objects created within Swing beyond my control is REALLY the work of
the devil :(
Regarding gdb, I often type
>break main
>r
at break point in main
> break -raise
> c
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.