On Wed, Jun 14, 2000 at 11:00:21PM +0200, Lionel Ulmer wrote:
> BTW, by reading the man page for XCreateImage, I found this :
>
> 'Note that when the image is created using XCreateImage, XGetImage,
> or XSubImage, the destroy procedure that the XDestroyImage function
> calls frees both the image structure and the data pointed to by the
> image structure.'
>
> I understand this as saying that calling XDestroyImage on an image
> created with XCreateImage (our case here) will free itself the image
> pointer... That would lead to a crash in our case at it would free a
> HeapAlloc allocated memory block, no ?
Yes it free()s image->data if it is non-NULL. So you can either
HeapFree the image data first and set the pointer to NULL or supply
your own destroy routine and pointer image->f.destroy_image at it.
Huw.
--
Dr. Huw D M Davies | Clarendon Laboratory
[EMAIL PROTECTED] | Parks Road
Tel: +44 1865 272390 | Oxford OX1 3PU
Fax: +44 1865 272400 | UK