@@ -1,24 +1,24 | |||
|
1 | 1 | using System; |
|
2 | 2 | |
|
3 | 3 | namespace Implab { |
|
4 |
public |
|
|
4 | public class ObjectPoolWrapper<T> : IDisposable { | |
|
5 | 5 | readonly T m_value; |
|
6 | 6 | readonly ObjectPool<T> m_pool; |
|
7 | 7 | |
|
8 | 8 | internal ObjectPoolWrapper(T value, ObjectPool<T> pool) { |
|
9 | 9 | m_value = value; |
|
10 | 10 | m_pool = pool; |
|
11 | 11 | } |
|
12 | 12 | |
|
13 | 13 | public T Value { |
|
14 | 14 | get { return m_value; } |
|
15 | 15 | } |
|
16 | 16 | |
|
17 | 17 | #region IDisposable implementation |
|
18 | 18 | public void Dispose() { |
|
19 | 19 | m_pool.Release(m_value); |
|
20 | 20 | } |
|
21 | 21 | #endregion |
|
22 | 22 | } |
|
23 | 23 | } |
|
24 | 24 |
General Comments 0
You need to be logged in to leave comments.
Login now