Back to index

salome-kernel  6.5.0
Public Member Functions
atExitSingleton Class Reference

To execute only once GENERIC_DESTRUCTOR::HouseKeeping et the end of process, a dedicated object is created, as a singleton: atExitSingleton. More...

List of all members.

Public Member Functions

 atExitSingleton (bool Make_ATEXIT)
 ~atExitSingleton ()

Detailed Description

To execute only once GENERIC_DESTRUCTOR::HouseKeeping et the end of process, a dedicated object is created, as a singleton: atExitSingleton.

When the singleton is created, the HouseKeeping() function is registered in atExit(). Destructors is a list created on heap, and deleted by HouseKeeping(), with the list content.

Definition at line 111 of file BasicsGenericDestructor.cxx.


Constructor & Destructor Documentation

atExitSingleton::atExitSingleton ( bool  Make_ATEXIT) [inline]

Definition at line 114 of file BasicsGenericDestructor.cxx.

  {
    if (Make_ATEXIT && !atExitSingletonDone)
      {
        DEVTRACE("atExitSingleton(" << Make_ATEXIT << ")");
        assert(GENERIC_DESTRUCTOR::Destructors == 0);
        GENERIC_DESTRUCTOR::Destructors = new std::list<GENERIC_DESTRUCTOR*>;
#ifndef _DEBUG_
        atexit(HouseKeeping);
#else
        int cr = atexit(HouseKeeping);
        assert(cr == 0);
#endif
        atExitSingletonDone = true;
      }
  }

Here is the call graph for this function:

Definition at line 131 of file BasicsGenericDestructor.cxx.

  {
    DEVTRACE("atExitSingleton::~atExitSingleton()");
  }

The documentation for this class was generated from the following file: