PDA

View Full Version : Stranger Error



avis_phoenix
8th September 2008, 23:51
In my program draw a path and this path is changing continuously(in a thread), but suddenly appear this error in GDB:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb5fffb90 (LWP 8229)]
0xb78b60f1 in QRegionPrivate::append (this=0xb6002e48, r=0xb60086f8)
at ../../include/QtCore/../../src/corelib/tools/qrect.h:245
245 { return y1; }
Current language: auto; currently c++

What could be?

jacek
9th September 2008, 00:23
What synchronization mechanism do you use and does this thread do exactly?

avis_phoenix
10th September 2008, 02:56
The thread (is a QThread) calculate the path, in the main thread (in the interface) draw the path .

I use connect (direct connect) to singals for draw.

jacek
10th September 2008, 11:45
I use connect (direct connect) to singals for draw.
If you use a direct signal, then the drawing is also done in that non-GUI thread, which is Bad(tm).

Use a queued connection to send an updated path to the GUI thread or use a mutex to protect the path while you draw it.