X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FEvents%2FEvents_Loop.cpp;h=ca8fb331cfb59a58606d39ce50321bdadf2fd050;hb=77ce6d35ac8d2f0fdaecb4f23e0870bf74e36103;hp=7b9d16b1c1285c63c164f0cc971047b70d978a3e;hpb=1de75803e9baf3de59fa755f9eccb6ef60bb64e4;p=modules%2Fshaper.git diff --git a/src/Events/Events_Loop.cpp b/src/Events/Events_Loop.cpp index 7b9d16b1c..ca8fb331c 100644 --- a/src/Events/Events_Loop.cpp +++ b/src/Events/Events_Loop.cpp @@ -1,8 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: Events_Loop.hxx -// Created: Thu Mar 13 2014 -// Author: Mikhail PONIKAROV +// Copyright (C) 2014-2024 CEA, EDF +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #include #include @@ -111,7 +124,7 @@ void Events_Loop::registerListener(Events_Listener* theListener, const Events_ID aFindID->second[theSender] = std::list(); aFindSender = aFindID->second.find(theSender); } - // check that listener was not registered wit hsuch parameters before + // check that listener was not registered with such parameters before std::list& aListeners = aFindSender->second; for (std::list::iterator aL = aListeners.begin(); aL != aListeners.end(); aL++) if (*aL == theListener) @@ -143,14 +156,14 @@ void Events_Loop::removeListener(Events_Listener* theListener) aLMap.erase(aLIt->first); myListeners[anIt->first] = aLMap; if (aLMap.empty()) - break; // avoid incrementation of the iterator if the the container is empty + break; // avoid incrementation of the iterator if the container is empty } aLIt++; } if (anIt->second.empty()) { myListeners.erase(anIt->first); if (myListeners.empty()) - break; // avoid incrementation of the iterator if the the container is empty + break; // avoid incrementation of the iterator if the container is empty } anIt++; } @@ -161,7 +174,7 @@ void Events_Loop::removeListener(Events_Listener* theListener) if (anImIt->second == theListener) { myImmediateListeners.erase(anImIt->first); if (myImmediateListeners.empty()) - break; // avoid incrementation of the iterator if the the container is empty + break; // avoid incrementation of the iterator if the container is empty } anImIt++; } @@ -187,9 +200,12 @@ void Events_Loop::flush(const Events_ID& theID) // TODO: Stabilization fix. Check later. if(myFlushed.find(theID.myID) != myFlushed.end()) { myFlushed.erase(myFlushed.find(theID.myID)); - } else { + } +#ifdef _DEBUG + else { bool aProblem = true; } +#endif } // send accumulated messages to "groupListeners" std::map > >::iterator aFindID =