diff options
author | paulby <[email protected]> | 2005-02-11 00:22:37 +0000 |
---|---|---|
committer | paulby <[email protected]> | 2005-02-11 00:22:37 +0000 |
commit | 9e03b00610ecb66a9ddd7a0f002a053025cd3f95 (patch) | |
tree | 987508caa4ea1d23fcb65e70efab4db154661d6a /src/classes/share/com | |
parent | 89a7289d313c4ee5562515c6bd273d86654c22b9 (diff) |
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
Diffstat (limited to 'src/classes/share/com')
-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(); } } |