osx - NSWindowController orderOut crashes in Mac Yosemite 10.10 -



osx - NSWindowController orderOut crashes in Mac Yosemite 10.10 -

the next code worked mavericks (10.9), 1 time upgraded yosemite 10.10 crashes. best way overcome sheets over-outs?

my class holds member:

emailclientwindowcontroller* emailclientsheet;

(while emailclientwindowcontroller : nswindowcontroller)

upon button click nowadays window modal sheet:

self.emailclientsheet = [[emailclientwindowcontroller alloc] initwithdocument:document]; [nsapp beginsheet:self.emailclientsheet.window modalforwindow:self.view.window modaldelegate:self didendselector:@selector(didendsheet:returncode:contextinfo:) contextinfo:nil];

and didendsheet method following:

- (void)didendsheet:(nswindow *)sheet returncode:(nsinteger)returncode contextinfo:(void *)contextinfo { self.emailclientsheet = nil; [sheet orderout:self]; }

but, line [sheet orderout:self] crashing in yosemite! , code has been working several years now! best way overcome issue?

thanks!

nili

solution replace order of nil assignment , orderout. meaning:

- (void)didendsheet:(nswindow *)sheet returncode:(nsinteger)returncode contextinfo:(void *)contextinfo { [sheet orderout:self]; self.emailclientsheet = nil; }

still didn't figure out apple changed in osx 10.10 in comparing 10.9, memory optimizations. didn't find related clues in 10.10 release notes nor in blogs. anyhow code improve releasing windows.

osx cocoa osx-yosemite

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -