Groups | Search | Server Info | Login | Register
Groups > comp.unix.programmer > #14549
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Newsgroups | comp.unix.programmer, comp.windows.x |
| Subject | Re: XDestroyImage() |
| Date | 2023-11-15 12:32 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <87bkbvkxi6.fsf@bsb.me.uk> (permalink) |
| References | <uiqsp7$54ll$1@dont-email.me> <uir1o9$5nkq$1@dont-email.me> <uisvuj$kdn3$1@dont-email.me> <871qctfnuo.fsf@nosuchdomain.example.com> |
Cross-posted to 2 groups.
Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
> Muttley@dastardlyhq.com writes:
>> On Sun, 12 Nov 2023 12:24:25 -0500
>> James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>>>In comp.unix.programmer Muttley@dastardlyhq.com wrote:
>>>> I'm a bit uncertain from the man page and from googling around whether
>>>> XDestroyImage() only frees the XImage structure created by XCreateImage()
>>>> or whether it also frees the user allocated memory that gets passed into
>>>> XCreateImage().
>>>
>>>The man page that I found describing the XDestroyImage macro says, quite
>>>prominently:
>>>
>>>"Note that when the image is created using XCreateImage(), XGetImage(),
>>>or XSubImage(), the destroy procedure that this macro calls frees both
>>>the image structure and the data pointed to by the image structure."
>>>
>>>Does the manpage you viewed lack that statement?
>>
>> Yes. All it says is:
>>
>> "The XDestroyImage function deallocates the memory associated with the
>> XImage structure."
>>
>> Which is ambiguous.
>
> That's very surprising. Looking at a Git mirror of libX11
> (https://github.com/mirror/libX11), that "Note that" paragraph appears
> in every version of that man page going back to 2003 (X11R6.6).
>
> On my system, Ubuntu 22.04, I get:
>
> $ man XDestroyImage | wc -l
> 139
> $ man XDestroyImage | tail -n 1
> X Version 11 libX11 1.7.5 XCreateImage(3)
> $ man XDestroyImage | sed -n '/Note that/,+3p'
> 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.
> $
>
> What do you get on your system? (You mentioned that you're on a Mac.)
Just as a random data point, on a Mac I have access to (but don't
understand well enough to say anything reliable about what software it
has installed) I get this:
$ man XDestroyImage | wc -l
140
$ man XDestroyImage | tail -n 1
X Version 11 libX11 1.5.0 XCreateImage(3)
$ man XDestroyImage | sed -n '/Note that/,+3p'
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.
--
Ben.
Back to comp.unix.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
XDestroyImage() Muttley@dastardlyhq.com - 2023-11-12 15:59 +0000
Re: XDestroyImage() kalevi@kolttonen.fi (Kalevi Kolttonen) - 2023-11-12 16:20 +0000
Re: XDestroyImage() Muttley@dastardlyhq.com - 2023-11-12 16:30 +0000
Re: XDestroyImage() James Kuyper <jameskuyper@alumni.caltech.edu> - 2023-11-12 12:24 -0500
Re: XDestroyImage() Muttley@dastardlyhq.com - 2023-11-13 11:05 +0000
Re: XDestroyImage() Winston <wbe@UBEBLOCK.psr.com.invalid> - 2023-11-13 11:53 -0500
Re: XDestroyImage() Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-11-13 11:35 -0800
Re: XDestroyImage() Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-11-15 12:32 +0000
Re: XDestroyImage() scott@slp53.sl.home (Scott Lurndal) - 2023-11-12 17:34 +0000
Re: XDestroyImage() candycanearter07 <no@thanks.net> - 2023-11-12 19:11 -0600
Re: XDestroyImage() Muttley@dastardlyhq.com - 2023-11-13 11:06 +0000
Re: XDestroyImage() scott@slp53.sl.home (Scott Lurndal) - 2023-11-13 14:59 +0000
Re: XDestroyImage() Muttley@dastardlyhq.com - 2023-11-13 15:57 +0000
Re: XDestroyImage() Nicolas George <nicolas$george@salle-s.org> - 2023-11-14 16:12 +0000
Re: XDestroyImage() candycanearter07 <no@thanks.net> - 2023-11-15 11:35 -0600
Re: XDestroyImage() Muttley@dastardlyhq.com - 2023-11-16 08:51 +0000
Re: XDestroyImage() candycanearter07 <no@thanks.net> - 2023-11-19 21:07 -0600
csiph-web