diff options
author | José Fonseca <[email protected]> | 2008-08-08 12:23:21 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2008-08-08 12:32:23 +0100 |
commit | 9dcb956a0618931c97693f7c74493cf296cfe86c (patch) | |
tree | ffc076c3e34dffd3dc8de5cf01ccb96939d4b797 /src/gallium/drivers/i915simple | |
parent | be36f7869e8ecc4b00e414557a9699ba373e6bdd (diff) |
gallium: Add destroy callback to all *_winsys interfaces.
For consistency and to simplify these objects' destruction.
Diffstat (limited to 'src/gallium/drivers/i915simple')
-rw-r--r-- | src/gallium/drivers/i915simple/i915_context.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/i915simple/i915_screen.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/i915simple/i915_winsys.h | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/i915simple/i915_context.c b/src/gallium/drivers/i915simple/i915_context.c index 4c01b8d5b17..e3d19017b5d 100644 --- a/src/gallium/drivers/i915simple/i915_context.c +++ b/src/gallium/drivers/i915simple/i915_context.c @@ -44,6 +44,9 @@ static void i915_destroy( struct pipe_context *pipe ) struct i915_context *i915 = i915_context( pipe ); draw_destroy( i915->draw ); + + if(i915->winsys) + i915->winsys->destroy(i915->winsys); FREE( i915 ); } diff --git a/src/gallium/drivers/i915simple/i915_screen.c b/src/gallium/drivers/i915simple/i915_screen.c index 4b1b8af7da8..0afa17bed85 100644 --- a/src/gallium/drivers/i915simple/i915_screen.c +++ b/src/gallium/drivers/i915simple/i915_screen.c @@ -193,6 +193,11 @@ i915_is_format_supported( struct pipe_screen *screen, static void i915_destroy_screen( struct pipe_screen *screen ) { + struct pipe_winsys *winsys = screen->winsys; + + if(winsys->destroy) + winsys->destroy(winsys); + FREE(screen); } diff --git a/src/gallium/drivers/i915simple/i915_winsys.h b/src/gallium/drivers/i915simple/i915_winsys.h index 9afaa16a62c..81904c2a742 100644 --- a/src/gallium/drivers/i915simple/i915_winsys.h +++ b/src/gallium/drivers/i915simple/i915_winsys.h @@ -75,6 +75,8 @@ struct pipe_screen; */ struct i915_winsys { + void (*destroy)( struct i915_winsys *sws ); + /** * Get the current batch buffer from the winsys. */ |