The radeon legacy code want to cleanup not free the texture obj,
so export a function to do that and wrap it.
* \param t Texture object to be destroyed
*/
-void driDestroyTextureObject( driTextureObject * t )
+void driCleanupTextureObject( driTextureObject * t )
{
driTexHeap * heap;
-
if ( 0 ) {
fprintf( stderr, "[%s:%d] freeing %p (tObj = %p, DriverData = %p)\n",
__FILE__, __LINE__,
}
remove_from_list( t );
- FREE( t );
}
if ( 0 ) {
}
+void driDestroyTextureObject( driTextureObject * t )
+{
+ driTexHeap * heap;
+
+ if (t == NULL)
+ return;
+
+ driCleanupTextureObject(t);
+ FREE(t);
+}
+
+
/**
void driUpdateTextureLRU( driTextureObject * t );
void driSwapOutTextureObject( driTextureObject * t );
+void driCleanupTextureObject( driTextureObject * t );
void driDestroyTextureObject( driTextureObject * t );
int driAllocateTexture( driTexHeap * const * heap_array, unsigned nr_heaps,
driTextureObject * t );
/* dma buffers */
bo_dma_free(&bo_legacy->base);
} else {
+ if (bo_legacy->got_dri_texture_obj)
+ driCleanupTextureObject(&bo_legacy->dri_texture_obj);
+
/* free backing store */
free(bo_legacy->ptr);
}
}
- memset(bo_legacy, 0 , sizeof(struct bo_legacy));
free(bo_legacy);
}