From cdc708dcda0b648f646e3fffa1658acf33a10721 Mon Sep 17 00:00:00 2001 From: NemesisMate Date: Thu, 23 Jun 2016 16:57:06 +0100 Subject: [PATCH] userdata to null again once all data is removed. --- jme3-core/src/main/java/com/jme3/scene/Spatial.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jme3-core/src/main/java/com/jme3/scene/Spatial.java b/jme3-core/src/main/java/com/jme3/scene/Spatial.java index d0369ca3c..d912b34b3 100644 --- a/jme3-core/src/main/java/com/jme3/scene/Spatial.java +++ b/jme3-core/src/main/java/com/jme3/scene/Spatial.java @@ -1530,6 +1530,9 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab if(data == null){ userData.remove(key); + if(userData.isEmpty()) { + userData = null; + } }else if (data instanceof Savable) { userData.put(key, (Savable) data); } else {