Skip to content

Commit 11b34f9

Browse files
committed
FIX : Pool leak fixed for non-inherited objects to be added to the pool.
1 parent 77032df commit 11b34f9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Assets/Scripts/ObjectPool/ObjectPooler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ private void Start()
4242

4343
if (obj.GetComponent<IPooledObject>() == null)
4444
{
45-
obj.AddComponent<PooledObject>();
45+
PooledObject temp = obj.AddComponent<PooledObject>();
46+
temp.Type = Pool[j].Tag;
4647
}
4748

4849
obj.SetActive(false);

ProjectSettings/ProjectVersion.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
m_EditorVersion: 2019.1.14f1
2-
m_EditorVersionWithRevision: 2019.1.14f1 (148b5891095a)
1+
m_EditorVersion: 2019.1.6f1
2+
m_EditorVersionWithRevision: 2019.1.6f1 (f2970305fe1c)

0 commit comments

Comments
 (0)