Revision: 7292
          http://svn.sourceforge.net/mahogany/?rev=7292&view=rev
Author:   vadz
Date:     2007-07-03 03:56:27 -0700 (Tue, 03 Jul 2007)

Log Message:
-----------
prevent recursive calls to CleanupFilterCache() which could happen if the 
filter module was unloaded as the result of the cleanup done by this function

Modified Paths:
--------------
    trunk/M/src/classes/MFilter.cpp

Modified: trunk/M/src/classes/MFilter.cpp
===================================================================
--- trunk/M/src/classes/MFilter.cpp     2007-07-02 11:12:09 UTC (rev 7291)
+++ trunk/M/src/classes/MFilter.cpp     2007-07-03 10:56:27 UTC (rev 7292)
@@ -29,6 +29,8 @@
 #   include <wx/dynarray.h>        // for WX_DECLARE_OBJARRAY
 #endif // USE_PCH
 
+#include <wx/recguard.h>
+
 #include "MFilter.h"
 #include "MFolder.h"
 #include "modules/Filters.h"
@@ -1010,6 +1012,16 @@
 void
 CleanupFilterCache()
 {
+   // it can happen that the filter module is unloaded when we delete the
+   // filter rules below, and as it calls us during its unload this results in
+   // fatal reentrancy problems, so prevent this from happening
+   static int s_inCleanUp = false;
+   wxRecursionGuard guard(s_inCleanUp);
+   if ( guard.IsInside() )
+      return;
+
+   s_inCleanUp = true;
+
    for ( FolderFiltersMap::const_iterator i = gs_folderFilters.begin();
          i != gs_folderFilters.end();
          ++i )


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to