From 1c82a92f0b6fc042abed2f74f811e549468d0660 Mon Sep 17 00:00:00 2001 From: Uldis Baurovskis Date: Sun, 27 May 2018 22:38:36 +0300 Subject: [PATCH] Fix crash on lime.utils.ObjectPool if size is set #1184 --- lime/utils/ObjectPool.hx | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/lime/utils/ObjectPool.hx b/lime/utils/ObjectPool.hx index 277bc656c..0aa54c622 100644 --- a/lime/utils/ObjectPool.hx +++ b/lime/utils/ObjectPool.hx @@ -25,24 +25,6 @@ import haxe.ds.ObjectMap; public function new (create:Void->T = null, clean:T->Void = null, size:Null = null) { - if (create != null) { - - this.create = create; - - } - - if (clean != null) { - - this.clean = clean; - - } - - if (size != null) { - - this.size = size; - - } - __pool = cast new ObjectMap (); activeObjects = 0; @@ -52,6 +34,15 @@ import haxe.ds.ObjectMap; __inactiveObject1 = null; __inactiveObjectList = new List (); + if (create != null) { + this.create = create; + } + if (clean != null) { + this.clean = clean; + } + if (size != null) { + this.size = size; + } }