Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bbn!ulowell!masscomp!karenb From: karenb@masscomp.UUCP (Karen ) Newsgroups: comp.windows.x Subject: XCreateImage/XDestroyImage question Message-ID: <1202@masscomp.UUCP> Date: 16 Jun 89 18:02:03 GMT Reply-To: karenb@masscomp.UUCP (Karen ) Organization: Concurrent Computer Corp., Westford, MA Lines: 26 I have a question about XCreateImage and XDestroyImage. What are you supposed to do in the following scenario? 1. You have some image data statically defined, say in an array. By static I mean it wasn't allocated using malloc. 2. You create an image using XCreateImage and the statically defined image data. XCreateImage allocates and sets up the image structure. 3. Then you're done with the image and want to free its structure. XDestroyImage will free both the image structure and the image data, but you don't want to free the image data because it's static. Is there a "best" way to do this? Should you set the data pointer in the image structure to NULL before calling XDestroyImage? Or call Xfree on the image structure? Or am I totally missing something? Thanks for any help, Karen -------------------------------------------------------------------------------- ___________ / ________/__ ...!{decvax,uunet}!masscomp!karenb /__/_______/ / karenb@westford.ccur.com Concurrent /__________/ Computer Corporation --------------------------------------------------------------------------------