| Summary: | Crash toggling fullscreen mode on Mac OS X | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Sam Lantinga <slouken> |
| Component: | video | Assignee: | Christian Walther <cwalther> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | cwalther, max |
| Version: | 1.2.11 | ||
| Hardware: | x86 | ||
| OS: | Mac OS X 10.4 (Intel) | ||
| Attachments: | Fix for some Cocoa memory management problems. | ||
|
Description
Sam Lantinga
2007-07-13 22:40:20 UTC
I'm looking at this. It appears to have something to do with the window being destroyed and recreated. It's better with the Cider patch, but still crashes after a window -> fullscreen -> window cycle. I'm going to try to create the window once and simply reuse it for each video mode. That's not going to work, since we need to be able to recreate the window. I did notice a crash in NSView that went away when I commented out [window_view release] Hmm... Christian, can you take a quick look at this one? If you can't figure it out, it can wait until the next patch release since it's been active for over a year without anyone reporting as far as I can tell. You'll probably need to remote debug it, since it involves a crash toggling fullscreen mode. I'll have a look, but probably not before tomorrow. Okay, thanks. I'll start working on packaging, getting everything ready to go for release, but it'll be probably a day or three before everything is put together. So far I've come up with the following, but it seems we're not done with that yet. I still get a crash originating from [qz_window close] when switching to fullscreen the second time (with NSZombie enabled, it can be caught by breaking on -[_NSZombie forward::]).
--- src/video/quartz/SDL_QuartzVideo.m (revision 3292)
+++ src/video/quartz/SDL_QuartzVideo.m (working copy)
@@ -369,8 +369,7 @@
/* If we still have a valid window, close it. */
if ( qz_window ) {
- [ qz_window close ];
- [ qz_window release ];
+ [ qz_window close ]; /* includes release because [qz_window isReleasedWhenClosed] */
qz_window = nil;
window_view = nil;
}
@@ -399,8 +398,7 @@
/* Release window mode resources */
else {
- [ qz_window close ];
- [ qz_window release ];
+ [ qz_window close ]; /* includes release because [qz_window isReleasedWhenClosed] */
qz_window = nil;
window_view = nil;
Plus another strange thing is that when moving the mouse for the first time after switching to fullscreen, the cursor leaves behind a black square with a white right and bottom border.
Created attachment 231 [details]
Fix for some Cocoa memory management problems.
OK, I think I've nailed the memory management problems with the attached patch. Too late for the release, but oh well. It shows that I haven't done much Cocoa lately... took me a while to figure out that NSWindows don't retain their delegate.
About the cursor issue I mentioned in the last message, I think I'll leave that to someone who has any actual interest in 8 bit mode...
Thanks, this looks great! I've checked it in with subversion revision 3380. We can enter another bug for the cursor issue. |