From: Ron F. <ro...@us...> - 2005-05-02 15:51:30
|
Update of /cvsroot/nsclspectcl/SpecTcl/Filter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28444/Filter Modified Files: Tag: SpecTcl-3-0_developmentreally FilterDictionary.cpp FilterDictionary.h Log Message: First passes at getting compilations on Intel C++: then fix defect 159: Open filters on exit can lose data. Index: FilterDictionary.h =================================================================== RCS file: /cvsroot/nsclspectcl/SpecTcl/Filter/FilterDictionary.h,v retrieving revision 5.1 retrieving revision 5.1.2.1 diff -C2 -d -r5.1 -r5.1.2.1 *** FilterDictionary.h 29 Nov 2004 16:56:00 -0000 5.1 --- FilterDictionary.h 2 May 2005 15:51:21 -0000 5.1.2.1 *************** *** 30,33 **** --- 30,34 ---- public: //protected: static CFilterDictionary* GetInstance(); + static void onExit(); // Called at app exit. }; // CFilterDictionary. Index: FilterDictionary.cpp =================================================================== RCS file: /cvsroot/nsclspectcl/SpecTcl/Filter/FilterDictionary.cpp,v retrieving revision 5.1.2.1 retrieving revision 5.1.2.2 diff -C2 -d -r5.1.2.1 -r5.1.2.2 *** FilterDictionary.cpp 21 Dec 2004 17:51:20 -0000 5.1.2.1 --- FilterDictionary.cpp 2 May 2005 15:51:21 -0000 5.1.2.2 *************** *** 11,15 **** #include <config.h> #include <vector> ! #include "Dictionary.h" --- 11,15 ---- #include <config.h> #include <vector> ! #include <Iostream.h> #include "Dictionary.h" *************** *** 31,34 **** --- 31,35 ---- if(m_pInstance == (CFilterDictionary*)kpNULL) { m_pInstance = new CFilterDictionary; + atexit(CFilterDictionary::onExit); } return m_pInstance; *************** *** 36,37 **** --- 37,57 ---- //return &instance; } + void + CFilterDictionary::onExit() + { + // Don't need to do anything if no filters + + cerr << "closing off filters\n"; + + if(m_pInstance) { + CFilterDictionaryIterator p = m_pInstance->begin(); + while(p != m_pInstance->end()) { + CGatedEventFilter* pFilter = p->second; + if(pFilter->CheckEnabled()) { + pFilter->Disable(); + cerr << "Closed filter: " << p->first << endl; + } + p++; + } + } + } |