mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-23 08:07:07 +00:00
Fix use of deallocated memory
This commit is contained in:
parent
03a2e7e152
commit
b9038250e6
1 changed files with 7 additions and 1 deletions
|
@ -803,6 +803,7 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
|||
XEvent xEvent;
|
||||
unsigned long *extents;
|
||||
Offsets *o = generic.offsets + (style & 15);
|
||||
int windowIdent;
|
||||
int repp = 0;
|
||||
int repx = 0;
|
||||
int repy = 0;
|
||||
|
@ -1131,6 +1132,11 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
|||
}
|
||||
}
|
||||
|
||||
/* Calling termwindow should cause the window to be destroyed,
|
||||
* so we need to take a copy of the window identifier to check
|
||||
* for events left in the queue about that window.
|
||||
*/
|
||||
windowIdent = window->ident;
|
||||
[self termwindow: window->number];
|
||||
XSync(dpy, False);
|
||||
while (XPending(dpy) > 0)
|
||||
|
@ -1138,7 +1144,7 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
|||
XNextEvent(dpy, &xEvent);
|
||||
NSDebugLLog(@"Offset", @"Destroying ... event %d window %lu\n",
|
||||
xEvent.type, xEvent.xany.window);
|
||||
if (xEvent.xany.window != window->ident)
|
||||
if (xEvent.xany.window != windowIdent)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue