Ignore:
Timestamp:
12/09/21 12:28:20 (3 years ago)
Author:
ymipsl
Message:

Tracking memory leak : release memory statically alocated

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp

    r2265 r2274  
    6363     for (std::vector<CContextClient*>::iterator it = clientPrimServer.begin(); it != clientPrimServer.end(); it++)  delete *it; 
    6464     for (std::vector<CContextServer*>::iterator it = serverPrimServer.begin(); it != serverPrimServer.end(); it++)  delete *it; 
    65  
     65     if (registryIn!=nullptr) delete registryIn ; 
     66     if (registryOut!=nullptr) delete registryOut ; 
    6667   } 
    6768 
     
    100101   CATCH 
    101102 
     103   void CContext::releaseStaticAllocation(void) 
     104   TRY 
     105   { 
     106      CDomain::releaseStaticAllocation(); 
     107      CAxis::releaseStaticAllocation(); 
     108      CScalar::releaseStaticAllocation(); 
     109      if (root) root.reset() ; 
     110   } 
     111   CATCH 
     112    
    102113   //---------------------------------------------------------------- 
    103114 
     
    326337  #include "node_type.conf" 
    327338*/ 
     339  CObjectFactory::deleteAllContexts<CContext>() ; 
     340  CObjectFactory::deleteAllContexts<CContextGroup>() ; 
     341  CObjectFactory::clearCurrentContextId(); 
     342  CGroupFactory::clearCurrentContextId(); 
    328343} 
    329344   ///--------------------------------------------------------------- 
     
    538553      if (commRank==0) 
    539554      { 
    540         if (attached_mode) CXios::getContextsManager()->createServerContext(CClient::getPoolRessource()->getId(), CXios::defaultServerId, 0, getContextId()) ; 
     555        if (attached_mode) CXios::getContextsManager()->createServerContext(CClient::getPoolRessource()->getId(), getContextId()+"_"+CXios::defaultServerId, 0, getContextId()) ; 
    541556        else if (CXios::usingServer2) CXios::getContextsManager()->createServerContext(CXios::defaultPoolId, CXios::defaultGathererId, 0, getContextId()) ; 
    542557        else  CXios::getContextsManager()->createServerContext(CXios::defaultPoolId, CXios::defaultServerId, 0, getContextId()) ; 
     
    547562      if (attached_mode) 
    548563      { 
    549         parentServerContext_->createIntercomm(CClient::getPoolRessource()->getId(), CXios::defaultServerId, 0, getContextId(), intraComm_,  
     564        parentServerContext_->createIntercomm(CClient::getPoolRessource()->getId(), getContextId()+"_"+CXios::defaultServerId, 0, getContextId(), intraComm_,  
    550565                                              interCommClient, interCommServer) ; 
    551566        int type ;  
     
    811826        closeAllFile(); 
    812827        client->releaseBuffers(); 
     828        server->releaseBuffers(); 
    813829      } 
    814830 
Note: See TracChangeset for help on using the changeset viewer.