Salome HOME
[EDF29150] : head monitoring file management
[modules/kernel.git] / src / Basics / BasicsGenericDestructor.cxx
index 23d91529d937c5ce762e2f7ff135f3711d455cf2..c4792af2d6f5ee20346b51bd687d0c12dfde7016 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // 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.
+// 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
@@ -59,8 +59,7 @@ void PROTECTED_DELETE::deleteInstance(PROTECTED_DELETE *anObject)
       return;
     else
       {
-        int ret;
-        ret = pthread_mutex_lock(&_listMutex); // acquire lock, an check again
+        pthread_mutex_lock(&_listMutex); // acquire lock, an check again
         if (std::find(_objList.begin(), _objList.end(), anObject)
             != _objList.end())
           {
@@ -69,7 +68,7 @@ void PROTECTED_DELETE::deleteInstance(PROTECTED_DELETE *anObject)
             DEVTRACE("PROTECTED_DELETE::deleteInstance2 " << &_objList);
             _objList.remove(anObject);
           }
-        ret = pthread_mutex_unlock(&_listMutex); // release lock
+        pthread_mutex_unlock(&_listMutex); // release lock
       }
   }
 
@@ -186,7 +185,7 @@ void HouseKeeping( void )
  */
 // ============================================================================
 
-const int GENERIC_DESTRUCTOR::Add(GENERIC_DESTRUCTOR &anObject)
+int GENERIC_DESTRUCTOR::Add(GENERIC_DESTRUCTOR &anObject)
 {
   DEVTRACE("GENERIC_DESTRUCTOR::Add("<<typeid(anObject).name()<<") "
            << &anObject);
@@ -196,5 +195,5 @@ const int GENERIC_DESTRUCTOR::Add(GENERIC_DESTRUCTOR &anObject)
     }
   assert(Destructors);
   Destructors->push_back(&anObject);
-  return Destructors->size();
+  return (int)Destructors->size();
 }