Home » U++ Library support » U++ MT-multithreading and servers » Fatal error - GuiLock
Re: Fatal error - GuiLock [message #39868 is a reply to message #39867] |
Wed, 08 May 2013 16:47 |
|
nlneilson wrote on Wed, 08 May 2013 03:43 | This only happens when the app is built in debug mode.
Fatal error
Assertion failed in C:\upp\uppsrc\CtrlCore\CtrlDraw.cpp, line 13
Using GUI in non-main thread without GuiLock
From inside another thread it is trying to change the data in a GUI EditField.
This is not a problem when built in Optimal, Speed or Size mode.
I have been using code for years without a GuiLock without problems. In java I had to inclose in try/catch.
I tried to run in debug and was curious as to why this pops up and kills the app.
|
Hi Neil,
It doesn't happpen in optimal mode, because ASSERTs are only compiled in debug mode. The problem is present in optimal as well, it is just not detected. Consider yourself lucky, if it didn't cause you any problems so far
Manipulating GUI is not thread safe, unless it is done in main thread or with GuiLock. Just add a GuiLock variable to the function (or scope) that touches the GUI, e.g.myFunction(){
GuiLock gl;
// doing something with GUI here
}
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Fri Jun 07 20:05:05 CEST 2024
Total time taken to generate the page: 0.02130 seconds
|