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++ Callbacks and Timers » Strange crash connected to Timer
Re: Strange crash connected to Timer [message #25769 is a reply to message #25764] Thu, 11 March 2010 07:52 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
nixnixnix wrote on Wed, 10 March 2010 15:39

Hi,

I've been getting regular but hard to repeat crashes so I let my software go in debug mode and found the attached call stack. I'm not sure if it is something I am doing or a slight bug in UPP that only I see because I run a function that looks like this

void OpenWind::OnTimer()
{
	// update the UI
	
	bool b = AreWeFree();
	
	m_pSaveButton->Enable(b);
	m_pNewButton->Enable(b);
	m_pEditButton->Enable(b);
	
	::SetTimeCallback(1000,THISBACK(OnTimer));	
}


in order to update the state of my toolbar buttons. As you can see, OnTimer is called every second for the whole time my software is running. The crash happens when I am running other threads concurrently. Am only posting this here because the call stack consists entirely of UPP code.

Nick



Well, my first guess would be that in some other thread you forgot to GuiLock.

Maybe it would be interesting to post here call stacks of all threads (in theide, you can easily achieve that - you can switch threads and you can also put the callstack into the clipboard).

Note:

::SetTimeCallback(-1000,THISBACK(OnTimer));


Negative time would repeat the callback, so there would be no need to reactivate it in OnTimer.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: PostCallback executes 2 at once?
Next Topic: partial parametrizing of Callback<>
Goto Forum:
  


Current Time: Tue Apr 16 17:28:41 CEST 2024

Total time taken to generate the page: 0.02611 seconds