| Summary: | Using SheepShaver with SDL 1.2.14 leads to a bunch of memory leaks | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Jean-Pierre <chombier> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | icculus |
| Version: | 1.2.14 | ||
| Hardware: | All | ||
| OS: | Mac OS X 10.6 | ||
(Sorry, some of these SDL-1.2 bugs have been sitting open for a long time.) The problem is that you're not supposed to do SDL video calls from anything but the main thread, even if it happens to work on some platforms. That being said, I think this is fixed in hg changeset 8e0dd46ad0e0. Feel free to reopen the bug if it isn't (and if you still care; again, sorry for the long delay!). --ryan. |
Every time the screen is refreshed (60 times per second at much), the console displays an error message: 31/10/09 12:52:59 SheepShaver-i386-SDL[7852] *** __NSAutoreleaseNoPool(): Object 0x45ebd0 of class NSWindowGraphicsContext autoreleased with no pool in place - just leaking Looking into SDL 1.2.14 source code, the Quartz 2D UpdateRects() function in SDL_QuartzVideo.m does indeed allocate an object of type NSWindowGraphicsContext, but SheepShaver's display thread is not the main one and has no AutoReleasePool allocated. To fix this, I added a 'CGContextRef wcg_context' field to the SDL_PrivateVideoData structure, Initialized it at the end of QZ_SetVideoWindowed(): this->UpdateRects = QZ_UpdateRects; this->LockHWSurface = QZ_LockHWSurface; this->UnlockHWSurface = QZ_UnlockHWSurface; + wcg_context = (CGContextRef) + [[NSGraphicsContext graphicsContextWithWindow: qz_window] + graphicsPort]; And used this wcg_context field in the UpdateRects() function instead of [NSGraphicsContext graphicsContextWithWindow]. No more leak. Best regards, - Jean-Pierre.