diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-03-10 09:53:14 -0400 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2009-03-10 09:53:14 -0400 |
commit | 945ccbbd4fa2b65ccdfb23716c178c95b036734d (patch) | |
tree | c99478903dbc270022210003a4536913b562e907 /src | |
parent | 03ec2099fdc859b23e5fa56ac8696ec045f1b110 (diff) |
radeon: clean more thoroughly in RADEONFreeRec()
Diffstat (limited to 'src')
-rw-r--r-- | src/radeon_driver.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c index f56a2928..2456dc58 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -348,7 +348,39 @@ static Bool RADEONGetRec(ScrnInfoPtr pScrn) /* Free our private RADEONInfoRec */ static void RADEONFreeRec(ScrnInfoPtr pScrn) { + RADEONInfoPtr info; + int i; + if (!pScrn || !pScrn->driverPrivate) return; + + info = RADEONPTR(pScrn); + + if (info->cp) { + xfree(info->cp); + info->cp = NULL; + } + + if (info->dri) { + xfree(info->dri); + info->dri = NULL; + } + + if (info->accel_state) { + xfree(info->accel_state); + info->accel_state = NULL; + } + + for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) { + if (info->encoders[i]) { + if (info->encoders[i]->dev_priv) { + xfree(info->encoders[i]->dev_priv); + info->encoders[i]->dev_priv = NULL; + } + xfree(info->encoders[i]); + info->encoders[i]= NULL; + } + } + xfree(pScrn->driverPrivate); pScrn->driverPrivate = NULL; } |