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
Fatal error - GuiLock [message #39867] Wed, 08 May 2013 03:43 Go to next message
nlneilson is currently offline  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 Go to previous messageGo to next 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
Re: Fatal error - GuiLock [message #39871 is a reply to message #39868] Wed, 08 May 2013 19:12 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
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.
Re: Fatal error - GuiLock [message #39878 is a reply to message #39871] Thu, 09 May 2013 07:23 Go 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 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 Smile

Honza
Previous Topic: How to close Skylark server except using Ctrl+C
Next Topic: Using Raw Values in arrays (with Skylark)
Goto Forum:
  


Current Time: Wed Jun 12 21:09:36 CEST 2024

Total time taken to generate the page: 0.02125 seconds