nanogui: Bug in MwDestroyWindow
Subject:
Bug in MwDestroyWindow
From:
"MrWGT" ####@####.####
Date:
1 Aug 2004 22:22:22 +0100
Message-Id: <200408012122.i71LMJJp001155@post.webmailer.de>
Hi...
i've discovered a bug in MwDestroyWindow:
/* Remove all messages from msg queue for this window*/
for(p=mwMsgHead.head; p; ) {
pmsg = GdItemAddr(p, MSG, link);
if(pmsg->hwnd == wp) {
p = p->next;
GdListRemove(&mwMsgHead, &pmsg->link);
GdItemFree(p); <<<< BUG!!!
} else
p = p->next;
}
The GdItemFree call should be GdItemFree(pmwg) i would say. p is pointing already to the next message (if any) and the old message pointer (pmsg) should be
freed. This small GdItemFree thing runs in X11 emulation without problems for > 300 window destroys but crashes on my embedded S3C2410 linux system after 3-
10 calls. If GdItemFree(p) is changed to GdItemFree(pmsg) i can run one day (after that u've aborted the test) without a crash.
This bug can be triggered by sending some messages to a window with PostMessage(...) (so the window does have some msg in the queue) and after sending
destroy the window. If there's no message waiting => no crash.
Regards,
Gerd