• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTimer - crash when closing window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTimer - crash when closing window


  • Subject: Re: NSTimer - crash when closing window
  • From: Jens Bauer <email@hidden>
  • Date: Sat, 11 Oct 2003 12:49:43 +0200

Hi Alastair,

On Saturday, Oct 11, 2003, at 12:44 Europe/Copenhagen, Alastair J.Houghton wrote:

On Saturday, October 11, 2003, at 10:33 am, Jens Bauer wrote:

I assume that the timerTask method has been invoked *after* the window was closed.
If I put the lines...

fprintf(stderr, "windowWillClose\n"); fflush(stderr);
fprintf(stderr, "dealloc\n"); fflush(stderr);

in both -dealloc and -windowWillClose, nothing is printed before the crash!
-Which means, it seems that neither windowWillClose, nor dealloc gets called before the crash.
-I've tried setting breakpoints in the 2 methods, but the debugger doesn't stop there either.

Should I do my cleanup in some method other than -dealloc and -windowWillClose then ??

I don't think that's the problem. I just tried to reproduce your problem on my machine, in both Cocoa and Cocoa Document-based applications, and my test program works just fine.

Perhaps you are corrupting some memory somewhere or something?

Most likely. -I'm *that* kind of guy.
-However, I've seen it in other apps I've written. I'll try and make an app from scratch, which will do the crash-trick. ;)

-Apart from this, I just tried adding the following 5 lines in my NSDocument subclass:

- (void)close
{
[self timerStop];
[super close];
}

And there's no more crashes.

-But I'll try and make a clean app, and see if it's in fact a memory-overwrite.. I don't expect that this happened, however, I won't claim it didn't. ;)


Love,
Jens
_______________________________________________
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.

References: 
 >Re: NSTimer - crash when closing window (From: "Alastair J.Houghton" <email@hidden>)

  • Prev by Date: Re: Searching dictionaries
  • Next by Date: [Solved] Re: NSTimer - crash when closing window
  • Previous by thread: Re: NSTimer - crash when closing window
  • Next by thread: [Solved] Re: NSTimer - crash when closing window
  • Index(es):
    • Date
    • Thread