Salome HOME
[EDF27816] : Fix bug presence of proxy into a list
authorAnthony Geay <anthony.geay@edf.fr>
Fri, 25 Aug 2023 14:36:00 +0000 (16:36 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Fri, 25 Aug 2023 14:36:00 +0000 (16:36 +0200)
src/Container/SALOME_PyNode.py
src/Container/Test/testProxy.py
src/KernelHelpers/KernelServices.cxx
src/KernelHelpers/KernelServices.hxx
src/KernelHelpers/KernelServices.i

index df59850ca00bde9f750b07a048c3689f92a4f209..1bb41877d1db9f41a55fed7dc982365fc391d531 100644 (file)
@@ -146,6 +146,7 @@ def IncrRefInFile(fname):
     cntb = f.read( GetSizeOfTCnt() )
   cnt = TypeCounter.from_buffer_copy( cntb ).value
   with open(fname,"rb+") as f:
+    #import KernelServices ; KernelServices.EntryForDebuggerBreakPoint()
     f.write( bytes( TypeCounter(cnt+1) ) )
 
 def DecrRefInFile(fname):
@@ -154,11 +155,9 @@ def DecrRefInFile(fname):
     cntb = f.read( GetSizeOfTCnt() )
   cnt = TypeCounter.from_buffer_copy( cntb ).value
   #
+  #import KernelServices ; KernelServices.EntryForDebuggerBreakPoint()
   if cnt == 1:
-    pass
-    #print("Remove {}".format(fname))
-    #print("Remove {}".format(str(GetObjectFromFile(fname)[0])))
-    #os.unlink( fname )
+    os.unlink( fname )
   else:
     with open(fname,"rb+") as f:
         f.write( bytes( TypeCounter(cnt-1) ) )
@@ -236,15 +235,6 @@ class BigObjectOnDiskBase:
     if self._destroy:
       DecrRefInFile( self._filename )
 
-  def delDebug(self):
-    import os
-    if self._destroy:
-      if os.path.exists( self._filename ):
-        DecrRefInFile( self._filename )
-      else:
-        import KernelServices
-        KernelServices.GenerateViolentMemoryFaultForTestPurpose()
-
   def getFileName(self):
     return self._filename
   
index 4ed4dce82ce6ca381b1ac65176bf90d4f4ffebc6..0dd0eeb38466fb0cae09f1339aeb2e711239afcd 100644 (file)
@@ -98,7 +98,7 @@ j = a,b,c"""
             del ret3
             import gc
             gc.collect(0)
-            #self.assertTrue( not os.path.exists( fn ) ) # at destruction of ret3 the corresponding pckl file must be destructed
+            self.assertTrue( not os.path.exists( fn ) ) # at destruction of ret3 the corresponding pckl file must be destructed
             cont.Shutdown()
 
 if __name__ == '__main__':
index 1626958c92b445ae036c7b292293c73af3006abb..c30aa41d1f82a923ba1eb01972f412d5d331b6f5 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "SALOME_KernelServices.hxx"
 
+#include <iostream>
+
 void RegisterCompoInternal(const std::string& compoName, const std::string& compoIOR)
 {
     CORBA::ORB_ptr orb = KERNEL::getORB();
@@ -42,3 +44,11 @@ void GenerateViolentMemoryFaultForTestPurpose()
     double *a = nullptr;
     *a = 0;
 }
+
+/*!
+ * This method wrapped into Python is useful to have a break point in C++ when complex python script is invoked in the stack
+ */
+void EntryForDebuggerBreakPoint()
+{
+    std::cout << "b KernelServices.cxx:53" << std::endl;
+}
index 5cb57378daeb9e76516d438c111c4b267707b314..52f965a2f56dade7632f373cb198464c86c62a57 100644 (file)
 //
 #ifndef __KERNELSERVICES_HXX__
 #define __KERNELSERVICES_HXX__
+
 #include <string>
 
 void RegisterCompoInternal(const std::string& compoName, const std::string& compoIOR);
 std::string RetrieveCompoInternal(const std::string& compoName);
 void GenerateViolentMemoryFaultForTestPurpose();
+void EntryForDebuggerBreakPoint();
+
 #endif
index c882b6584b39c9f2d0383808aabe11f3f9f2ec10..e884001ddeae797477c1dc4e85ff917e463e8e7e 100644 (file)
@@ -59,6 +59,7 @@ public:
     void RegisterCompoInternal(const std::string& compoName, const std::string& compoIOR);
     std::string RetrieveCompoInternal(const std::string& compoName);
     void GenerateViolentMemoryFaultForTestPurpose();
+    void EntryForDebuggerBreakPoint();
 }
 
 %pythoncode %{