diff options
Diffstat (limited to 'src/classes/share')
-rw-r--r-- | src/classes/share/com/sun/j3d/utils/geometry/Primitive.java | 11 | ||||
-rw-r--r-- | src/classes/share/com/sun/j3d/utils/universe/SimpleUniverse.java | 4 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/classes/share/com/sun/j3d/utils/geometry/Primitive.java b/src/classes/share/com/sun/j3d/utils/geometry/Primitive.java index 2c34b88..aa606be 100644 --- a/src/classes/share/com/sun/j3d/utils/geometry/Primitive.java +++ b/src/classes/share/com/sun/j3d/utils/geometry/Primitive.java @@ -258,5 +258,16 @@ public abstract class Primitive extends Group { return((GeomBuffer) cache); } + + /** + * Clear the shared geometry cache for all Primitive types. + * Existing Shapes with shared geometry will continue to share + * the geometry. New Primitives will create new shared geometry. + * + * @since Java 3D 1.3.2 + */ + public static void clearGeometryCache() { + geomCache.clear(); + } } diff --git a/src/classes/share/com/sun/j3d/utils/universe/SimpleUniverse.java b/src/classes/share/com/sun/j3d/utils/universe/SimpleUniverse.java index 1b9c343..55f562b 100644 --- a/src/classes/share/com/sun/j3d/utils/universe/SimpleUniverse.java +++ b/src/classes/share/com/sun/j3d/utils/universe/SimpleUniverse.java @@ -44,12 +44,13 @@ package com.sun.j3d.utils.universe; +import com.sun.j3d.utils.geometry.Primitive; import java.awt.GraphicsEnvironment; import java.awt.GraphicsConfiguration; import java.net.URL; import javax.media.j3d.*; -import javax.vecmath.*; + /** * This class sets up a minimal user environment to quickly and easily @@ -407,6 +408,7 @@ public class SimpleUniverse extends VirtualUniverse { removeAllLocales(); // viewerMap cleanup here to prevent memory leak problem. Viewer.clearViewerMap(); + Primitive.clearGeometryCache(); } } |