xserver-multidpi/glx
Adam Jackson 276d8057aa glx: Fix memory leak in context garbage collection (v2)
I broke this, back in:

    commit a48dadc98a
    Author: Adam Jackson <ajax@redhat.com>
    Date:   Mon Mar 21 11:59:29 2011 -0400

	glx: Reimplement context tags

In that, I changed the glx client state to not explicitly track the list
of current contexts for the client (since that was what we were deriving
tags from).  The bug was that I removed the code for same from
glxClientCallback without noticing that it had the side effect of
effectively de-currenting those contexts, so that ContextGone could free
them.  So, if you had a client exit with a context still current, the
context's memory would leak.  Not a huge deal for direct clients, but
viciously bad for indirect, since the swrast context state at the bottom
of Mesa is like 15M.

Fix this by promoting Bool isCurrent to ClientPtr currentClient, so that
we have a back-pointer to chase when walking the list of contexts when
ClientStateGone happens.

v2: Explicitly call __glXFreeContext on the ClientStateGone path.  Our
current context might be one we got from EXT_import_context and whose
creating client has since died.  Without the explicit call, the creating
client's FreeClientResources would not free the context because it's
still current, and the using client's FreeClientResources would not free
the context because it's not an XID it created.  This matches the logic
from a48dadc.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-29 10:30:43 -04:00
..
clientinfo.c glx: Implement GLX SetClientInfo2ARB protocol 2012-07-05 11:44:09 -07:00
createcontext.c glx: Fix memory leak in context garbage collection (v2) 2013-10-29 10:30:43 -04:00
dispatch.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
extension_string.c Full support of sRGB capable fbconfigs. 2013-03-18 10:02:00 -07:00
extension_string.h Full support of sRGB capable fbconfigs. 2013-03-18 10:02:00 -07:00
glapi_gentable.c glapi: Correct size of allocated _glapi_table struct 2012-04-23 20:20:42 -07:00
glapi.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
glapi.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
glapitable.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
glprocs.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
glthread.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
glthread.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
glxbyteorder.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
glxcmds.c glx: Fix memory leak in context garbage collection (v2) 2013-10-29 10:30:43 -04:00
glxcmdsswap.c Remove unneccesary casts from WriteToClient calls 2012-07-09 19:12:56 -07:00
glxcontext.h glx: Fix memory leak in context garbage collection (v2) 2013-10-29 10:30:43 -04:00
glxdrawable.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
glxdri.c os: Use ErrorFSigSafe from FatalError and it's friends 2013-05-07 09:41:14 +10:00
glxdri2.c dri2: Don't bother with xf86LoaderCheckSymbol("DRI2Connect") 2013-09-10 13:28:24 -04:00
glxdricommon.c glx: Add support for the new DRI loader entrypoint. 2013-10-23 08:12:28 +08:00
glxdricommon.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
glxdriswrast.c glx: Extend __GLXscreen::createContext to take attributes 2012-05-23 13:07:51 -07:00
glxext.c glx: Fix memory leak in context garbage collection (v2) 2013-10-29 10:30:43 -04:00
glxext.h glx: Use one function to add a context to all global tables 2012-05-23 13:08:12 -07:00
glxscreens.c glx: Remove support for NV_vertex_program and NV_fragment_program 2013-09-11 14:37:32 -04:00
glxscreens.h glx: Remove screen number from __GLXconfig 2013-09-11 14:37:33 -04:00
glxserver.h Restore extern to the declaration of __glXDRISWRastProvider 2012-07-12 13:25:57 +01:00
glxutil.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
indirect_dispatch_swap.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
indirect_dispatch.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
indirect_dispatch.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
indirect_program.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
indirect_reqsize.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
indirect_reqsize.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
indirect_size_get.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
indirect_size_get.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
indirect_size.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
indirect_table.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
indirect_table.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
indirect_texture_compression.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
indirect_util.c Remove unneccesary casts from WriteToClient calls 2012-07-09 19:12:56 -07:00
indirect_util.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
Makefile.am Replace INCLUDES with AM_CPPFLAGS 2013-08-06 13:08:13 +10:00
render2.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
render2swap.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
renderpix.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
renderpixswap.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
rensize.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
single2.c Use C99 designated initializers in glx Replies 2012-07-09 19:58:30 -07:00
single2swap.c Use C99 designated initializers in glx Replies 2012-07-09 19:58:30 -07:00
singlepix.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
singlepixswap.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
singlesize.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
singlesize.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
swap_interval.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
unpack.h Remove unneccesary casts from WriteToClient calls 2012-07-09 19:12:56 -07:00
xfont.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00