Thread View: comp.os.linux.x
2 messages
2 total messages
Started by Tristan
Fri, 17 Jan 1997 00:00
XCheckMaskEvent() causes memory leak ?
Author: Tristan
Date: Fri, 17 Jan 1997 00:00
Date: Fri, 17 Jan 1997 00:00
49 lines
2782 bytes
2782 bytes
Please excuse any inappropriate cross-posting.
I noticed that each call to XCheckMaskEvent() causes some
memory to be allocated by a malloc() call, and NOT
subsequently freed before XCheckMaskEvent() returns.
I could observe this happening both under Linux (Xfree86)
and under Solaris 2.5.
This causes a memory leak to happen in applications that
call XCheckMaskEvent() very often, for example in a loop.
My questions are:
- Is it normal or is that a bug of XCheckMaskEvent() ?
- If this is normal, what is the application supposed to do to
free the memory that is allocated by XCheckMaskEvent() ?
- If it is a bug, is there a workaround ?
By the way, according to the manpage for XCheckMaskEvent(),
I don't see why XCheckMaskEvent() should allocate any memory
and not free it:
Bool XCheckMaskEvent(display, event_mask, event_return)
Display *display;
long event_mask;
XEvent *event_return;
The XCheckMaskEvent function searches the event queue and
then any events available on the server connection for the
first event that matches the specified mask. If it finds
a match, XCheckMaskEvent removes that event, copies it
into the specified XEvent structure, and returns True.
The other events stored in the queue are not discarded.
If the event you requested is not available, XCheck๏ฟฝ
MaskEvent returns False, and the output buffer will have
been flushed.
Please help!
Regards, -- Tristan Savatier (mailto:tristan@mpegtv.com)
MpegTV website: http://www.mpegtv.com
MPEG.ORG website: http://www.mpeg.org
Re: XCheckMaskEvent() causes memory leak ?
Author: Adrian Bridgett
Date: Sat, 18 Jan 1997 00:00
Date: Sat, 18 Jan 1997 00:00
19 lines
1390 bytes
1390 bytes
In comp.os.linux.x Tristan <tristan@creative.net> wrote: > Please excuse any inappropriate cross-posting. > I noticed that each call to XCheckMaskEvent() causes some > memory to be allocated by a malloc() call, and NOT > subsequently freed before XCheckMaskEvent() returns. It is probably worth posting this to XFree86@XFree86.Org. There is a bug reporting page at http://www.XFree86.org/cgi-bin/bugform.cgi Good work! Adrian =============================================================================== adrian.bridgett@poboxes.com http://www.netforward.com/poboxes/?Adrian.Bridgett ------------------------------------------------------------------------------- Windows95 - the world's first NON-operating system.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads