equal
deleted
inserted
replaced
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() |