aboutsummaryrefslogtreecommitdiff
path: root/generic/tkZinc.c
diff options
context:
space:
mode:
authorlecoanet2004-05-03 08:42:07 +0000
committerlecoanet2004-05-03 08:42:07 +0000
commit9b860c88befc6f6f4ba9fa31494f2697a0917c25 (patch)
treef21ccab340ef3830e2faf1e1b66833144a989b5c /generic/tkZinc.c
parentc0787856f8a784f35897deea6966a91265520ee8 (diff)
downloadtkzinc-9b860c88befc6f6f4ba9fa31494f2697a0917c25.zip
tkzinc-9b860c88befc6f6f4ba9fa31494f2697a0917c25.tar.gz
tkzinc-9b860c88befc6f6f4ba9fa31494f2697a0917c25.tar.bz2
tkzinc-9b860c88befc6f6f4ba9fa31494f2697a0917c25.tar.xz
Fix a very nasty memory bug under Perl/Tk windows.
Diffstat (limited to 'generic/tkZinc.c')
-rw-r--r--generic/tkZinc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/tkZinc.c b/generic/tkZinc.c
index 00b2e35..135ddb2 100644
--- a/generic/tkZinc.c
+++ b/generic/tkZinc.c
@@ -7070,23 +7070,23 @@ Event(ClientData client_data, /* Information about widget. */
* Set the real top window above us.
*/
{
- Window parent, root, *children;
+ Window parent, root, *children=NULL;
Tk_Window top_level;
- int num_children;
+ int num_children, success;
top_level = wi->win;
while (!Tk_IsTopLevel(top_level)) {
top_level = Tk_Parent(top_level);
}
- XQueryTree(wi->dpy, Tk_WindowId(top_level), &root, &parent,
- &children, &num_children);
+ success = XQueryTree(wi->dpy, Tk_WindowId(top_level), &root, &parent,
+ &children, &num_children);
if (root == parent) {
wi->real_top = Tk_WindowId(top_level);
}
else {
wi->real_top = parent;
}
- if (children) {
+ if (children && success) {
XFree(children);
}
}