Home » U++ Library support » U++ MT-multithreading and servers » Fatal error - GuiLock
Fatal error - GuiLock [message #39867] |
Wed, 08 May 2013 03:43 |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
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.
|
|
|
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
|
|
|
|
Re: Fatal error - GuiLock [message #39878 is a reply to message #39871] |
Thu, 09 May 2013 07:23 |
|
nlneilson wrote on Wed, 08 May 2013 19:12 | Hi Honza
I will try the 'GuiLock gl;' and try it. If each thread has a GuiLock it will interesting to see if they interfere.
|
Well, if you haven't see any crashes or problems up until now, then adding GuiLock shouldn't make much difference
Honza
|
|
|
Goto Forum:
Current Time: Sat May 11 10:32:11 CEST 2024
Total time taken to generate the page: 0.02700 seconds
|