• 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
delaying document close
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

delaying document close


  • Subject: delaying document close
  • From: Martin Hewitson <email@hidden>
  • Date: Sat, 08 Dec 2012 08:28:01 +0100

Dear list,

I have a document based app which has a number of per-document background tasks fired off timers. After moving from GC to ARC the app was suffering from crashes when closing documents due to the referencing of deallocated objects. So I've gone through the whole app and implemented -tearDown methods which I then call from my document subclass -windowWillClose:. In many of the -tearDown methods I deactivate the relevant timers by doing, for example,

- (void) stopMetadataTimer
{
  if (self.metadataTimer) {
    [self.aQueue cancelAllOperations];
    self.aQueue = nil;
    [self.metadataTimer invalidate];
    self.metadataTimer = nil;
  }
}

But I still get occasional crashes so I was wondering if there is a way to delay the closing of the document by one or two seconds to allow all the background processes which may be executing to finish before pulling the rug out from beneath their feet.

Best wishes,

Martin





_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: delaying document close
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: How to implement readonly property
  • Next by Date: PDFKit two page display differs from Preview
  • Previous by thread: Re: How to implement readonly property
  • Next by thread: Re: delaying document close
  • Index(es):
    • Date
    • Thread