]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CCAR: remove memory leaks in non local SALOMEDS
authorcaremoli <caremoli>
Mon, 14 Sep 2009 08:45:03 +0000 (08:45 +0000)
committercaremoli <caremoli>
Mon, 14 Sep 2009 08:45:03 +0000 (08:45 +0000)
src/SALOMEDS/SALOMEDS_AttributeIOR.cxx
src/SALOMEDS/SALOMEDS_AttributeIOR_i.cxx
src/SALOMEDS/SALOMEDS_AttributeIOR_i.hxx
src/SALOMEDS/SALOMEDS_AttributeName.cxx
src/SALOMEDS/SALOMEDS_AttributePixMap.cxx
src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx

index 121d87587f3921ebac4fcb4813f1e4dfadbbe3b3..f82fbf353d343149aa321fcef37d96833141b53f 100644 (file)
@@ -46,7 +46,7 @@ std::string SALOMEDS_AttributeIOR::Value()
     SALOMEDS::Locker lock;
     aValue = dynamic_cast<SALOMEDSImpl_AttributeIOR*>(_local_impl)->Value();
   }
-  else aValue = SALOMEDS::AttributeIOR::_narrow(_corba_impl)->Value();
+  else aValue = (CORBA::String_var)((SALOMEDS::AttributeIOR_var)SALOMEDS::AttributeIOR::_narrow(_corba_impl))->Value();
   return aValue;
 }
 
@@ -57,5 +57,5 @@ void SALOMEDS_AttributeIOR::SetValue(const std::string& value)
     SALOMEDS::Locker lock;
     dynamic_cast<SALOMEDSImpl_AttributeIOR*>(_local_impl)->SetValue(value);
   }
-  else SALOMEDS::AttributeIOR::_narrow(_corba_impl)->SetValue(value.c_str());
+  else ((SALOMEDS::AttributeIOR_var)SALOMEDS::AttributeIOR::_narrow(_corba_impl))->SetValue(value.c_str());
 }
index 79aee1e5b17a9ec8a51f09a21e8802589ab13e49..4a74580ec59c89d88bf6e58cc046884c8f811bc8 100644 (file)
@@ -77,3 +77,6 @@ void SALOMEDS_AttributeIOR_i::SetValue(const char* value)
   string anExtStr((char *)Str.in());
   dynamic_cast<SALOMEDSImpl_AttributeIOR*>(_impl)->SetValue(anExtStr);
 }
+
+SALOMEDS_AttributeIOR_i::~SALOMEDS_AttributeIOR_i()
+{}
index c5f05dcb79b62ce6c798ee23545174756f95befa..a1c415c3dcea46a21b8304cdfb972786a2a643bd 100644 (file)
@@ -39,7 +39,7 @@ public:
   SALOMEDS_AttributeIOR_i(SALOMEDSImpl_AttributeIOR* theAttr, CORBA::ORB_ptr orb) 
     :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
 
-  ~SALOMEDS_AttributeIOR_i() {};
+  ~SALOMEDS_AttributeIOR_i();
 
   char* Value();
   void SetValue(const char* value);
index 86a384dddc9b1323eb65cd7087abe5a25a42fa6f..4fac58cbbbf1777b45b33b9cfed33e1a6880a9c9 100644 (file)
@@ -46,7 +46,7 @@ std::string SALOMEDS_AttributeName::Value()
     SALOMEDS::Locker lock; 
     aValue = dynamic_cast<SALOMEDSImpl_AttributeName*>(_local_impl)->Value();
   }
-  else aValue = SALOMEDS::AttributeName::_narrow(_corba_impl)->Value();
+  else aValue = (CORBA::String_var)((SALOMEDS::AttributeName_var)SALOMEDS::AttributeName::_narrow(_corba_impl))->Value();
   return aValue;
 }
 
@@ -57,5 +57,5 @@ void SALOMEDS_AttributeName::SetValue(const std::string& value)
     SALOMEDS::Locker lock; 
     dynamic_cast<SALOMEDSImpl_AttributeName*>(_local_impl)->SetValue(value);
   }
-  else SALOMEDS::AttributeName::_narrow(_corba_impl)->SetValue(value.c_str());
+  else ((SALOMEDS::AttributeName_var)SALOMEDS::AttributeName::_narrow(_corba_impl))->SetValue(value.c_str());
 }
index c7cd068ccb678c5fcc3ceb2354b2743cebb29e01..d18ed86b33d59f22d284155d303ddc630869e617 100644 (file)
@@ -46,7 +46,7 @@ bool SALOMEDS_AttributePixMap::HasPixMap()
     SALOMEDS::Locker lock;
     ret = dynamic_cast<SALOMEDSImpl_AttributePixMap*>(_local_impl)->HasPixMap();
   }
-  else ret = SALOMEDS::AttributePixMap::_narrow(_corba_impl)->HasPixMap();
+  else ret = ((SALOMEDS::AttributePixMap_var)SALOMEDS::AttributePixMap::_narrow(_corba_impl))->HasPixMap();
   return ret;
 }
 
@@ -57,7 +57,7 @@ std::string SALOMEDS_AttributePixMap::GetPixMap()
     SALOMEDS::Locker lock;
     aValue = dynamic_cast<SALOMEDSImpl_AttributePixMap*>(_local_impl)->GetPixMap();
   }
-  else aValue = SALOMEDS::AttributePixMap::_narrow(_corba_impl)->GetPixMap();
+  else aValue = (CORBA::String_var)((SALOMEDS::AttributePixMap_var)SALOMEDS::AttributePixMap::_narrow(_corba_impl))->GetPixMap();
   return aValue;
 }
 
@@ -68,5 +68,5 @@ void SALOMEDS_AttributePixMap::SetPixMap(const std::string& value)
     SALOMEDS::Locker lock;
     dynamic_cast<SALOMEDSImpl_AttributePixMap*>(_local_impl)->SetPixMap(value);
   }
-  else SALOMEDS::AttributePixMap::_narrow(_corba_impl)->SetPixMap(value.c_str());
+  else ((SALOMEDS::AttributePixMap_var)SALOMEDS::AttributePixMap::_narrow(_corba_impl))->SetPixMap(value.c_str());
 }
index d8eacff0ad3d8f6ea4c695bb666d35fdf6b96b84..111ea32c763cea322346fd08413e55c4d2592945 100644 (file)
@@ -51,7 +51,7 @@ void SALOMEDS_AttributeStudyProperties::SetUserName(const std::string& theName)
       dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl);
     anImpl->ChangeCreatorName(theName);
   } else
-    SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetUserName(theName.c_str());
+    ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->SetUserName(theName.c_str());
 }
 
 std::string SALOMEDS_AttributeStudyProperties::GetUserName()
@@ -62,9 +62,9 @@ std::string SALOMEDS_AttributeStudyProperties::GetUserName()
     aName = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->GetCreatorName();
   }
 #ifndef WIN32
-  else aName = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->GetUserName();
+  else aName = ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->GetUserName();
 #else
-  else aName = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->GetUserNameA();
+  else aName = ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->GetUserNameA();
 #endif
   return aName;
 }
@@ -82,7 +82,7 @@ void SALOMEDS_AttributeStudyProperties::SetCreationDate
     string S;
     anImpl->SetModification(S, theMinute, theHour, theDay, theMonth, theYear);
   } else {
-    SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetCreationDate(theMinute,
+    ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->SetCreationDate(theMinute,
                                                                              theHour,
                                                                              theDay,
                                                                              theMonth,
@@ -103,7 +103,7 @@ bool SALOMEDS_AttributeStudyProperties::GetCreationDate(int& theMinute,
       (_local_impl)->GetCreationDate(theMinute, theHour, theDay, theMonth, theYear);
   } else {
     CORBA::Long aMinute, anHour, aDay, aMonth, anYear;
-    ret = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->GetCreationDate(aMinute,
+    ret = ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->GetCreationDate(aMinute,
                                                                                    anHour,
                                                                                    aDay,
                                                                                    aMonth,
@@ -129,7 +129,7 @@ void SALOMEDS_AttributeStudyProperties::SetCreationMode(const std::string& theMo
     else //Not defined
       dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->SetCreationMode(0);
   }
-  else SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetCreationMode(theMode.c_str());
+  else ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->SetCreationMode(theMode.c_str());
 }
 
 std::string SALOMEDS_AttributeStudyProperties::GetCreationMode()
@@ -142,7 +142,7 @@ std::string SALOMEDS_AttributeStudyProperties::GetCreationMode()
     if (mode == 2) aMode = "copy from";
   }
   else
-    aMode = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->GetCreationMode();
+    aMode = ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->GetCreationMode();
   return aMode;
 }
 
@@ -153,7 +153,7 @@ void SALOMEDS_AttributeStudyProperties::SetModified(int theModified)
     dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->SetModified(theModified);
   }
   else
-    SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetModified(theModified);
+    ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->SetModified(theModified);
 }
 
 bool SALOMEDS_AttributeStudyProperties::IsModified()
@@ -164,7 +164,7 @@ bool SALOMEDS_AttributeStudyProperties::IsModified()
     ret = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->IsModified();
   }
   else
-    ret = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->IsModified();
+    ret = ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->IsModified();
   return ret;
 }
 
@@ -176,7 +176,7 @@ int SALOMEDS_AttributeStudyProperties::GetModified()
     isModified = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->GetModified();
   }
   else
-    isModified = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->GetModified();
+    isModified = ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->GetModified();
   return isModified;
 }
 
@@ -187,7 +187,7 @@ void SALOMEDS_AttributeStudyProperties::SetLocked(bool theLocked)
     dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->SetLocked(theLocked);
   }
   else
-    SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetLocked(theLocked);
+    ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->SetLocked(theLocked);
 }
 
 bool SALOMEDS_AttributeStudyProperties::IsLocked()
@@ -198,7 +198,7 @@ bool SALOMEDS_AttributeStudyProperties::IsLocked()
     ret = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->IsLocked();
   }
   else
-    ret = SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->IsLocked();
+    ret = ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->IsLocked();
   return ret;
 }
 
@@ -215,7 +215,7 @@ void SALOMEDS_AttributeStudyProperties::SetModification(const std::string& theNa
     SALOMEDSImpl_AttributeStudyProperties* anImpl = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl);
     anImpl->SetModification(theName, theMinute, theHour, theDay, theMonth, theYear);
   } else
-    SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->SetModification(theName.c_str(),
+    ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->SetModification(theName.c_str(),
                                                                               theMinute,
                                                                               theHour,
                                                                               theDay,
@@ -252,7 +252,7 @@ void SALOMEDS_AttributeStudyProperties::GetModificationsList(std::vector<std::st
   } else {
     SALOMEDS::StringSeq_var aNames;
     SALOMEDS::LongSeq_var aMinutes, aHours, aDays, aMonths, aYears;
-    SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl)->GetModificationsList(aNames.out(),
+    ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->GetModificationsList(aNames.out(),
                                                                                   aMinutes.out(),
                                                                                   aHours.out(),
                                                                                   aDays.out(),