xserver/hw/xquartz/xpr
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
..
Makefile.am XQuartz: remove undefined XSERVER_CFLAGS variable 2010-03-15 08:24:02 -07:00
appledri.c XQuartz: Move use of static dispatch procs after declaration 2010-09-28 09:50:34 -07:00
appledri.h XQuartz: Add support for GLXPixmaps to the AppleDRI. 2009-02-16 21:42:45 -08:00
appledristr.h XQuartz: Pad xAppleDRINotifyEvent to 32bytes to match sizeof(xEvent) 2009-04-01 13:52:52 -07:00
dri.c XQuartz: Fix a memory leak with surfaces that a new test found. 2011-07-19 19:49:47 -07:00
dri.h XQuartz: Add support for GLXPixmaps to the AppleDRI. 2009-02-16 21:42:45 -08:00
driWrap.c xquartz: Delete compile-time-constant DRIGCRec.driOps field. 2010-09-13 15:55:17 -07:00
driWrap.h XQuartz: Add driWrap.h that I missed in the last commit. 2009-02-16 21:42:54 -08:00
dristruct.h Merge branch 'master' into XACE-SELINUX 2007-12-13 18:38:25 -05:00
x-hash.c XQuartz: LP64 related casting fixes from Bob Murphy 2008-10-31 19:03:38 -07:00
x-hash.h XQuartz: Fix a bunch of compilation warnings about style 2009-09-27 23:31:35 -07:00
x-hook.c Replace X-allocation functions with their C89 counterparts 2010-05-13 00:22:37 +07:00
x-hook.h Darwin: Flattened quartz into darwin, renamed darwin xquartz 2007-12-05 20:32:40 -08:00
x-list.c x-list.c: null-returning function malloc() was called without checking 2010-05-02 15:27:29 -07:00
x-list.h Darwin: Flattened quartz into darwin, renamed darwin xquartz 2007-12-05 20:32:40 -08:00
xpr.h XQuartz: ASL: Use xpr subsystem for logging xpr messages 2011-06-01 21:18:44 -07:00
xprAppleWM.c XQuartz: Fix compilation warnings with XPLUGIN_VERSION >= 4 2011-04-25 18:57:02 -07:00
xprCursor.c XQuartz: ASL: Use xpr subsystem for logging xpr messages 2011-06-01 21:18:44 -07:00
xprEvent.c XQuartz: ASL: Use xpr subsystem for logging xpr messages 2011-06-01 21:18:44 -07:00
xprEvent.h XQuartz: Transition from xEvent based mieq to InternalEvent 2009-09-27 23:31:07 -07:00
xprFrame.c XQuartz: Use a rwlock instead of a mutex to protect window_hash in the pthread case 2011-04-29 11:04:42 -07:00
xprScreen.c XQuartz: ASL: Use xpr subsystem for logging xpr messages 2011-06-01 21:18:44 -07:00