webengine/osswebengine/MemoryManager/Src/MemoryManager.cpp
changeset 5 10e98eab6f85
parent 1 7c90e6132015
child 25 0ed94ceaa377
equal deleted inserted replaced
1:7c90e6132015 5:10e98eab6f85
    28 
    28 
    29 // CLASS DECLARATION
    29 // CLASS DECLARATION
    30 
    30 
    31 //  initializing a global memory pool.
    31 //  initializing a global memory pool.
    32 static CMemoryPool *s_pool = 0;
    32 static CMemoryPool *s_pool = 0;
       
    33 
       
    34 struct cleanupMemoryPool {
       
    35     ~cleanupMemoryPool() {
       
    36     	if(s_pool)
       
    37     		{
       
    38     		delete s_pool;
       
    39     		s_pool = NULL;
       
    40     		}
       
    41     }
       
    42 };
       
    43 static cleanupMemoryPool deleteMemoryPool;
    33 
    44 
    34 //-----------------------------------------------------------------------------
    45 //-----------------------------------------------------------------------------
    35 // Pool() - a utility function for accessing the right memory pool
    46 // Pool() - a utility function for accessing the right memory pool
    36 //-----------------------------------------------------------------------------
    47 //-----------------------------------------------------------------------------
    37 inline CMemoryPool* Pool() 
    48 inline CMemoryPool* Pool()