Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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 Smile

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
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to close Skylark server except using Ctrl+C
Next Topic: Using Raw Values in arrays (with Skylark)
Goto Forum:
  


Current Time: Fri Jun 07 20:05:05 CEST 2024

Total time taken to generate the page: 0.02130 seconds