diff --git a/inc/hgl/type/Pool.cpp b/inc/hgl/type/Pool.cpp index 8523687..d29c90d 100644 --- a/inc/hgl/type/Pool.cpp +++ b/inc/hgl/type/Pool.cpp @@ -32,6 +32,9 @@ namespace hgl max_count=0; return 0; } + + max_count=mc; + return mc; } template @@ -42,7 +45,7 @@ namespace hgl if(max_count>0&&alloc_count>=max_count) return(false); - result=Create(); + value=Create(); alloc_count++; @@ -57,7 +60,11 @@ namespace hgl template bool Pool::Get(T &value) { - return Inactive.Pop(value); + if(!Inactive.Pop(value)) + return(false); + + Active.Add(value); + return(true); } template @@ -125,7 +132,7 @@ namespace hgl template void Pool::Clear(T *dp,int dc) { - for(int i=0;i class Pool