Call to PtDamageWidget causes application crash

Hi!

I am having a problem where a call to PtDamageWidget causes the
application to crash (under QNX 6.3). Calling PtWidgetIsRealized with
the same pointer immediately before calling PtDamageWidget returns 1.
Any ideas out there what could be going on???

Thanks,

Jochen.

Jochen Ditterich wrote:

Hi!

I am having a problem where a call to PtDamageWidget causes the
application to crash (under QNX 6.3). Calling PtWidgetIsRealized with
the same pointer immediately before calling PtDamageWidget returns 1.
Any ideas out there what could be going on???

Thanks,

Jochen.

What kind of widget? If not too long, post the code.

Cheers

Garry

“Jochen Ditterich” <jd@shadlen.org> wrote in message
news:cpdaoq$86v$1@inn.qnx.com

I am having a problem where a call to PtDamageWidget causes the
application to crash (under QNX 6.3). Calling PtWidgetIsRealized with the
same pointer immediately before calling PtDamageWidget returns 1. Any
ideas out there what could be going on???

Most likely your widget pointer doesn’t point to a widget – is it possible
that the widget you’re trying to damage has been destroyed?

PtWidgetIsRealized() doesn’t crash because is a simple macro that just reads
the flags from the widget. As long as there are at least a few bytes of
memory where the pointer points to, PtWidgetIsRealized() will return some
value. PtDamageWidget(), on the other hand, attempts to locate the widget’s
ancestors and update their damage lists, which gives it many opportunities
to to hit a bad pointer and crash if the original pointer doesn’t point to a
valid widget.

I found it! It happened to be a call from inside a signal handler
(apparently a bad idea) …

Thanks for your help,

Jochen.

Jochen Ditterich wrote:

Hi!

I am having a problem where a call to PtDamageWidget causes the
application to crash (under QNX 6.3). Calling PtWidgetIsRealized with
the same pointer immediately before calling PtDamageWidget returns 1.
Any ideas out there what could be going on???

Thanks,

Jochen.