From: <mrj...@us...> - 2007-10-28 19:00:28
|
Revision: 2270 http://tora.svn.sourceforge.net/tora/?rev=2270&view=rev Author: mrjohnson0 Date: 2007-10-28 12:00:31 -0700 (Sun, 28 Oct 2007) Log Message: ----------- hack to fix crasher when selecting a tool from the toolbar or menu. changeConnection() is getting called from another thread, which is not supposed to touch gui classes. this may need to move execution to the mainthread instead or post a message (or however the heck you're supposed to do such things in qt). Modified Paths: -------------- branches/tora-1.4/tora/src/tomain.cpp Modified: branches/tora-1.4/tora/src/tomain.cpp =================================================================== --- branches/tora-1.4/tora/src/tomain.cpp 2007-10-28 04:18:39 UTC (rev 2269) +++ branches/tora-1.4/tora/src/tomain.cpp 2007-10-28 19:00:31 UTC (rev 2270) @@ -1212,6 +1212,13 @@ void toMain::changeConnection(void) { + // TODO qt4's way of handling threads seems to be to die in the + // most horrible way possible. make sure we're running in the main + // thread to avoid a crash. this fixes bug when clicking on + // toolbar or menu. + if(!toThread::mainThread()) + return; + try { toConnection &conn = currentConnection(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |