From: Brian P. <bri...@tu...> - 2005-06-20 19:52:24
|
ma...@co... wrote: > Hi all, > > At the end of tilesortspu_context.c, the existing code in > tilesortspu_DestroyContext looks like this: > > /* Destroy the tilesort state context */ > crFree(contextInfo->server); > crStateDestroyContext(contextInfo->State); > crHashtableDelete(tilesort_spu.contextTable, ctx, crFree); > > /* The default buffer */ > crPackSetBuffer( thread0->packer, &(thread->geometry_buffer) ); > > crDLMFreeContext(contextInfo->dlmContext); > > ------- > > The problem is that, apparently, crHashtableDelete is deleting the data > pointed to by contextInfo. (contextInfo is retrieved from the hashtable > earlier in the function.) > > So, a version that seems to work better for me (i.e. no crash on context > deletion) is: > > /* Destroy the tilesort state context */ > crFree(contextInfo->server); > crStateDestroyContext(contextInfo->State); > > /* The default buffer */ > crPackSetBuffer( thread0->packer, &(thread->geometry_buffer) ); > > crDLMFreeContext(contextInfo->dlmContext); > > crHashtableDelete(tilesort_spu.contextTable, ctx, crFree); > > ---- That looks like a good fix. I'll check it in. -Brian |