CVS: M/src/gui wxMApp.cpp,1.310,1.311

Vadim Zeitlin <[email protected]>
Newsgroups gmane.mail.mahogany.cvs
Message-ID <[email protected]>
Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6638/src/gui

Modified Files:
	wxMApp.cpp 
Log Message:
ignore command and char events received while c-client is locked, this should fix mm_fatal() calls when we try to do something in response to such event called from inside wxProgressDialog::Update() which calls wxYield()

Index: wxMApp.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMApp.cpp,v
retrieving revision 1.310
retrieving revision 1.311
diff -b -u -2 -r1.310 -r1.311
--- wxMApp.cpp	4 Sep 2006 23:15:35 -0000	1.310
+++ wxMApp.cpp	18 Sep 2006 23:47:27 -0000	1.311
@@ -622,4 +622,21 @@
 }
 
+int wxMApp::FilterEvent(wxEvent& event)
+{
+   // quickly bail out if we're not inside c-client currently
+   if ( AllowBgProcessing() )
+      return -1;
+
+   if ( event.IsCommandEvent() || event.GetEventType() == wxEVT_CHAR )
+   {
+      // these events are dangerous to handle now as they can result in another
+      // call to c-client being made so just ignore them
+      return false;
+   }
+
+   // the other events should be safe to handle
+   return -1;
+}
+
 bool
 wxMApp::AllowBgProcessing() const


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.