xserver/hw/xquartz
George Staplin 4fe7df2653 XQuartz: Fix a memory leak with surfaces that a new test found.
xp_destroy_surface was called with a surface id of 0, due to some
premature cleanup that set it to 0.  This means the surfaces
weren't being destroyed until the window was.

The code that did that was: pDRIDrawablePriv->sid = 0;

In long running applications this leak may or may not have been
harmful.  With the old libGL the surfaces weren't destroyed until
the context was destroyed or a new context created.  In the new
libGL they are reference counted, and released much sooner, so we
ran into a resource leak more noticeably with some tests.

Make the Apple DRI code dispatch events to the client(s) for
destroyed surfaces, when a resource is destroyed.  This seems to
work in my tests, however this clearly wasn't working for a while,
so bugs may result in the future if it enables some new (unexpected)
side effects.

Also add a few helpful comments to aid in understanding the code
in the future.

Tested with the test suite, Pymol, and various Mesa demos.
(cherry picked from commit bede83eb19a1629396fcd5a46441f8476a8fcd1b)
2011-07-19 19:49:47 -07:00
..
GL XQuartz: DRI: Dead code removal 2011-07-19 19:49:45 -07:00
bundle XQuartz: Rename launchd-id-prefix to bundle-id-prefix 2011-04-25 18:57:04 -07:00
mach-startup XQuartz: Fix Makefile dependencies 2011-06-28 13:07:20 -07:00
man XQuartz: Update DEBUG_LOG to report to ASL 2011-05-22 11:17:59 -07:00
pbproxy XQuartz: xpbproxy: Correct NSUInteger format strings 2011-06-01 21:57:52 -07:00
xpr XQuartz: Fix a memory leak with surfaces that a new test found. 2011-07-19 19:49:47 -07:00
Makefile.am XQuartz: Redirect stdout/stderr to asl 2011-05-12 20:19:40 -07:00
X11Application.h XQuartz: prefs_copy_url and prefs_get_copy return retained objects 2011-05-03 10:54:09 -07:00
X11Application.m XQuartz: Add some sanity checking and a fallback for the bundle id. 2011-07-18 22:54:21 -07:00
X11Controller.h XQuartz: Just NSBeep() for XBell() 2010-12-08 13:57:19 -08:00
X11Controller.m XQuartz: Just NSBeep() for XBell() 2010-12-08 13:57:19 -08:00
applewm.c XQuartz: applewm: Don't check if requested window level is < 0 because it is unsigned (-Wtautological-compare) 2011-03-23 12:10:15 -07:00
applewmExt.h XQuartz: Fix incorrect typedefs with XPLUGIN_VERSION < 4 2011-04-29 11:06:18 -07:00
console_redirect.c XQuartz: Fix an array-index-out-of-bounds crasher 2011-05-14 19:15:26 -07:00
console_redirect.h XQuartz: Redirect stdout/stderr to asl 2011-05-12 20:19:40 -07:00
darwin.c input: free the EQ allocated memory on shutdown (#38634) 2011-07-01 08:46:28 +10:00
darwin.h XQuartz: ASL: Update logging to support differnet levels and subsystems 2011-06-01 21:07:56 -07:00
darwinEvents.c XQuartz: DarwinEQFini doesn't return Bool 2011-07-15 10:40:12 -07:00
darwinEvents.h XQuartz: DarwinEQFini doesn't return Bool 2011-07-15 10:40:12 -07:00
darwinXinput.c input: free the EQ allocated memory on shutdown (#38634) 2011-07-01 08:46:28 +10:00
darwinfb.h XQuartz: Unify how we set our bitmasks for visuals 2009-07-31 15:34:13 -07:00
keysym2ucs.c Darwin: Flattened quartz into darwin, renamed darwin xquartz 2007-12-05 20:32:40 -08:00
keysym2ucs.h Darwin: Flattened quartz into darwin, renamed darwin xquartz 2007-12-05 20:32:40 -08:00
pseudoramiX.c Delete panoramiXdataPtr: it's redundant. 2010-06-03 14:03:23 -07:00
pseudoramiX.h Darwin: Flattened quartz into darwin, renamed darwin xquartz 2007-12-05 20:32:40 -08:00
quartz.c XQuartz: Don't crash if CG increases our display resolution 2011-05-22 11:17:59 -07:00
quartz.h XQuartz: xpr: Use a serial queue rather than pthread mutexes for window_hash 2011-04-25 18:57:03 -07:00
quartzCocoa.m XQuartz: Remove some dead code. 2010-07-13 08:27:36 -07:00
quartzCommon.h XQuartz: RandR: Don't change the rootless preference when changing RandR mode 2010-09-28 09:50:35 -07:00
quartzKeyboard.c XQuartz: Don't circumvent NDEBUG 2011-05-13 09:10:42 -07:00
quartzKeyboard.h hw/xquartz: remove duplicated includes 2011-04-24 19:46:07 -07:00
quartzRandR.c XQuartz: RandR: Don't crash if X11 is launched while there are no attached displays 2011-05-22 11:17:59 -07:00
quartzRandR.h XQuartz: RandR: Refactor legacy mode-switching to be better integrated with RandR 2010-09-28 10:09:11 -07:00
quartzStartup.c XQuartz: Mark functions _X_NORETURN 2011-05-22 11:17:59 -07:00
sanitizedCarbon.h XQuartz: Handled sanitization of namespace better 2008-04-18 20:07:55 -07:00
sanitizedCocoa.h XQuartz: Ensure that {CF,NS}_RETURNS{,_NOT}_RETAINED are defined 2011-05-03 10:39:31 -07:00