Re: NSScreen being autoreleased during loadNib()

Kyle Sluder <[email protected]> Thu, 30 May 2013 19:09:27 -0700
Newsgroups gmane.comp.macosx.devel
Message-ID <1369966167.11879.140661237909693.226D5BCF@webmail.messagingengine.com>
On Thu, May 30, 2013, at 06:46 PM, Jacky.Seraph Mu wrote:
> After having executed the line "A Problem happens", I found that the
> content of the screen (that is, the *screen) changed.

No, what actually happened is that the stack space/register for `screen`
was reused by the compiler, so `p *screen` dereferenced whatever value
got stuffed in the former storage for `screen`. You got (un)lucky and
this dereference didn't cause an access violation.

--Kyle Sluder