On Tue, 12 Oct 1999, WATANABE AKIRA wrote:
But, I think that GrDestroyPattern can not free the memory created by GrBuildPixmapFromBits() completely.
Oliginal source : Oliginal code can free a top of the frame memory area only. void GrDestroyPattern(GrPattern *p) { if(p->gp_ispixmap) { if(p->gp_pxp_source.gf_memflags & GCM_MYMEMORY) farfree(p->gp_pxp_source.gf_baseaddr); if(p->gp_pxp_source.gf_memflags & GCM_MYCONTEXT) free(p); return; } if(p->gp_bitmap.bmp_memflags) free(p); }
This is code from GRX v2.2. The v2.3 code is different and equvilent to your changes.
What do you think about above code?
Good. But no need to change grx v2.3
I found the changelog notice about the bugfix (v2.2 -> v2.3 changes)
98/02/24 Fixed a bug in GrDestroyPattern() when freeing the bitmap planes (found&patched by Michal).
Hartmut