From cb07a3659702ee90974965b60877dc082d2418dc Mon Sep 17 00:00:00 2001 From: Railz Date: Wed, 27 Feb 2019 15:57:57 +0100 Subject: [PATCH] Added validation to counter too many items being spawned and therefore being deleted right away. --- ManagedPool/Pool_T_.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ManagedPool/Pool_T_.cs b/ManagedPool/Pool_T_.cs index fb4e65d..d26e248 100644 --- a/ManagedPool/Pool_T_.cs +++ b/ManagedPool/Pool_T_.cs @@ -87,6 +87,7 @@ namespace eu.railduction.netcore.dll.ManagedPool if (batch <= 0) throw new InvalidOperationException($"Invalid parameter batch='{batch}'. Must be at least '1'!"); if (increaseBuffer <= 0) throw new InvalidOperationException($"Invalid parameter increaseBuffer='{increaseBuffer}'. Must be at least '1'!"); if (decreaseBuffer <= 0) throw new InvalidOperationException($"Invalid parameter decreaseBuffer='{decreaseBuffer}'. Must be at least '1'!"); + if (batch < decreaseBuffer) throw new InvalidOperationException($"Invalid parameter decreaseBuffer='{decreaseBuffer}'. Must be at least batch='{batch}'!"); } private T getItem()