Article View: comp.os.linux.x
Article #173XCheckMaskEvent() causes memory leak ?
From: 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
Technical Details
Message-ID:
<32E04B68.5DE79003@creative.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 1667f1,a386631e0f50256,start X-Google-Attributes: gid1667f1,public X-Google-Thread: 157100,a386631e0f50256,start X-Google-Attributes: gid157100,public X-Google-Thread: 103734,a386631e0f50256,start X-Google-Attributes: gid103734,public X-Google-Thread: f4bda,a386631e0f50256,start X-Google-Attributes: gidf4bda,public X-Google-Thread: 15dded,a386631e0f50256,start X-Google-Attributes: gid15dded,public X-Google-Thread: 10d8a4,a386631e0f50256,start X-Google-Attributes: gid10d8a4,public X-Google-Thread: f9a37,a386631e0f50256,start X-Google-Attributes: gidf9a37,public From: Tristan <tristan@creative.net> Subject: XCheckMaskEvent() causes memory leak ? Date: 1997/01/17 Message-ID: <32E04B68.5DE79003@creative.net> X-Deja-AN: 210563518 content-type: text/plain; charset=iso-8859-1 organization: Posted via CAIS Internet <info@cais.com> mime-version: 1.0 newsgroups: comp.os.linux.x,comp.windows.x,fj.windows.x,,fr.comp.windows.x11,no.x,,relcom.x,,uiuc.cs.windows.x x-mailer: Mozilla 3.01 (X11; I; Linux 2.0.0 i586)