From 9e03b00610ecb66a9ddd7a0f002a053025cd3f95 Mon Sep 17 00:00:00 2001 From: paulby Date: Fri, 11 Feb 2005 00:22:37 +0000 Subject: Fix for issue 101. Thanks Alessandro. Issue number: 101 Obtained from: aces Submitted by: paulby Reviewed by: kcr git-svn-id: https://svn.java.net/svn/j3d-core-utils~svn/trunk@39 9497e636-51bd-65ba-982d-a4982e1767a5 --- src/classes/share/com/sun/j3d/utils/geometry/Primitive.java | 11 +++++++++++ .../share/com/sun/j3d/utils/universe/SimpleUniverse.java | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) 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(); } } -- cgit v1.2.3