• 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
Weird problem involving memory management and global variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird problem involving memory management and global variable


  • Subject: Weird problem involving memory management and global variable
  • From: Sam Stigler <email@hidden>
  • Date: Tue, 29 May 2007 19:13:43 +1000

Hi,

I've spent the past several hours trying to tackle a very annoying problem relating to a global variable I have declared in my MyDocument.h: It is declared there, but I am allocating and initializing in the document's windowControllerDidLoadNib: method Everything seems to be fine until another method in the same class asks for the variable, at which point (although the variable's retainCount is still 2) I receive an EXC_BAD_ACCESS and KERN_PROTECTION_FAILURE. Does anyone know why this could be? I've posted the relevant code to http://homepage.mac.com/sstigler1985/ memoryproblem.html .

Thanks,
Sam

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: Weird problem involving memory management and global variable
      • From: mmalc Crawford <email@hidden>
    • Re: Weird problem involving memory management and global variable
      • From: Manfred Schwind <email@hidden>
  • Prev by Date: Re: cocoa and ms windows
  • Next by Date: Window freezes app
  • Previous by thread: How to read NSComboBox auto-completed string?
  • Next by thread: Re: Weird problem involving memory management and global variable
  • Index(es):
    • Date
    • Thread