xserver/hw/xquartz
George Staplin d0bb22ed78 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 bede83eb19)
(cherry picked from commit 4fe7df2653)
2011-07-19 23:02:13 -07:00
..
bundle XQuartz: Bump bundle version to 2.6.3 2011-05-16 21:07:37 -07:00
GL XQuartz: DRI: Dead code removal 2011-07-19 23:02:08 -07:00
mach-startup XQuartz: Don't call into CoreFoundation after fork() and before exec() 2011-05-13 23:30:01 -07:00
man Xquartz: rename man page directory from doc to man 2011-01-18 15:11:18 -08:00
pbproxy XQuartz: Don't call mieqEnqueue during server shutdown 2011-05-16 18:47:20 -07:00
xpr XQuartz: Fix a memory leak with surfaces that a new test found. 2011-07-19 23:02:13 -07:00
applewm.c XQuartz: Move use of static dispatch procs after declaration 2010-09-28 09:50:34 -07:00
applewmExt.h XQuartz: Fix incorrect typedefs with XPLUGIN_VERSION < 4 2011-05-04 18:39:04 -07:00
darwin.c XQuartz: Remove one more backing store leftover 2010-12-03 16:46:44 -08:00
darwin.h Change the devPrivates API to require dixRegisterPrivateKey 2010-06-05 19:23:03 -07:00
darwinEvents.c XQuartz: Fix prototypes for thread functions 2011-04-27 18:56:01 -07:00
darwinEvents.h XQuartz: Transition from xEvent based mieq to InternalEvent 2009-09-27 23:31:07 -07:00
darwinfb.h XQuartz: Unify how we set our bitmasks for visuals 2009-07-31 15:34:13 -07:00
darwinXinput.c XQuartz: Remove unused CloseInputDevice stub 2010-11-24 01:47:16 -05: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
Makefile.am Xquartz: rename man page directory from doc to man 2011-01-18 15:11:18 -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 21:39:42 -07:00
quartz.h XQuartz: RandR: Capture the display when switching modes with RandR 2011-03-03 18:15:15 -08: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: Just NSBeep() for XBell() 2010-12-08 13:57:19 -08:00
quartzKeyboard.h XQuartz: Add a defaults option to toggle Alt / Mode_switch 2010-04-11 16:30:19 -07:00
quartzRandR.c XQuartz: RandR: Don't crash if X11 is launched while there are no attached displays 2011-05-22 21:39:37 -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: Just NSBeep() for XBell() 2010-12-08 13:57:19 -08:00
sanitizedCarbon.h XQuartz: Handled sanitization of namespace better 2008-04-18 20:07:55 -07:00
sanitizedCocoa.h XQuartz: Handled sanitization of namespace better 2008-04-18 20:07:55 -07:00
threadSafety.c XQuartz: spewCallStack is noop on Tiger now... 2008-11-21 10:59:41 -08:00
threadSafety.h XQuartz: Cleaned up startup and thread creation a tad. 2008-04-26 19:21:05 -07:00
X11Application.h XQuartz: RandR: Provide an alert box when entering a RandR mode for the first time. 2011-03-03 18:15:15 -08:00
X11Application.m XQuartz: Add some sanity checking and a fallback for the bundle id. 2011-07-19 22:52:10 -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