diff options
author | Brian Paul <[email protected]> | 2012-01-11 19:52:23 +0100 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-01-11 13:10:43 -0700 |
commit | dce4c368b5536716770e5cabef0321db8537a6d9 (patch) | |
tree | 5453eb4cefb94522697811fb4972d6cbd1a55c59 /src/glx/dri_common.c | |
parent | 35cdd7b6dbc763fe57bf466def0a4257ca09beb8 (diff) |
svga: don't reference count svga_sampler_view's texture
svga_sampler_view contains a pointer to a pipe_resource (base class of
svga_texture) and svga_texture contains a pointer to an svga_sampler_view.
This circular dependency prevented the objects from ever being freed when
they pointed to each other. Make the svga_sampler_view::texture pointer
a "weak reference" (no reference counting) to break the dependency.
This is safe to do because the pipe_resource/texture always has a longer
lifespan than the sampler view so when svga_sampler_view stops referencing
the texture, the texture's refcount never hits zero.
Fixes a memory leak seen with google earth and other apps.
Reviewed-by: Jakob Bornecrantz <[email protected]>
Diffstat (limited to 'src/glx/dri_common.c')
0 files changed, 0 insertions, 0 deletions