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 » Draw, Display, Images, Bitmaps, Icons » bug in ImageBuffer::Line() and operator[]
Re: bug in ImageBuffer::Line() and operator[] [message #15425 is a reply to message #15424] Wed, 23 April 2008 10:34 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member

void Layer::MakeLayerAsThread(Layer* pLayer,double op,void* pMain,int n)
{
	ImageMT* ptr = (ImageMT*)pMain;

	Layer* pNewLayer = new Layer(pLayer,op,pMain);	
	
	ptr->AddLayer(pNewLayer);
	ptr->Refresh(); //<< !!! You can only do GUI in the main thread!!!
	AtomicDec(ptr->threads); // the last thing this thread does is clean up
}


Calls to anything defined in CtrlCore and beyond is only allowed in the main thread, with the exception of event queue calls.

Means that instead of calling Refresh directly, you must use event queue to pass this into the main thread. Best use

void KillSetTimeCallback(int delay_ms, Callback cb, int id);


variant (to remove any other identical Refresh from the queue).

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: problems drawing in Linux (ubuntu 7.10)
Next Topic: Bug: ImageBuffer::alpha not initialised on X11
Goto Forum:
  


Current Time: Thu Sep 04 02:47:03 CEST 2025

Total time taken to generate the page: 0.03799 seconds