diff options
author | Tom Stellard <[email protected]> | 2015-01-07 13:49:12 -0500 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2015-01-07 16:28:40 -0500 |
commit | e28f9d0e60468db429e75a27443f7df52da224a2 (patch) | |
tree | ade64ee26aa7fe4df5fc6c4de41be280d81a1add /src/gallium/drivers/radeonsi/si_pipe.c | |
parent | 2b7fd5b11df95869249a1bdc6e1b222747aaa075 (diff) |
radeonsi: Fix crash when destroying si_screen
We were invalidating si_screen:tm by calling
r600_destroy_common_screen() which frees the si_screen object. This
caused the driver to crash in LLVMDisposeTargetMachine() since we
were passing it an invalid pointer.
https://bugs.freedesktop.org/show_bug.cgi?id=88170
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_pipe.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 38bff31e005..e3f8fcf8032 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -424,11 +424,13 @@ static void si_destroy_screen(struct pipe_screen* pscreen) if (!sscreen->b.ws->unref(sscreen->b.ws)) return; - r600_destroy_common_screen(&sscreen->b); - #if HAVE_LLVM >= 0x0306 + // r600_destroy_common_screen() frees sscreen, so we need to make + // sure to dispose the TargetMachine before we call it. LLVMDisposeTargetMachine(sscreen->tm); #endif + + r600_destroy_common_screen(&sscreen->b); } #define SI_TILE_MODE_COLOR_2D_8BPP 14 |