How do I verify a window pointer?

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

2 posts / 0 new
Last post
How do I verify a window pointer?

Submitted by Anonymous on Thu, 05/30/2002 - 14:00. Developers
I have a program that is crashing when XGetWindowAttributes()
or XGetWindowProperty() is called. The crash happens in an
event handler, and seems to be created in a situation where
the window that generated the event dies before the handler
is actually called.

I think the crash is happening because the window pointer is
bad. It seems that sometimes XGetWindowAttributes or
XGetWindowProperty crashes in this situation. Is there a
better or more appropriate way to verify that a window is valid
before using the Window pointer in a call to XGetWindowAttributes()
or XGetWindowProperty()?

Thanks!

Brian

Anonymous

Doh! Figured out my problem. I had set up an error handler via
XSetErrorHandler, and the error handler was calling abort(). This
was why I was seeing the core dumping, and I can easily fix this
by removing the abort() call. Thanks anyway