Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions jme3-core/src/main/java/com/jme3/scene/Spatial.java
Original file line number Diff line number Diff line change
Expand Up @@ -706,15 +706,21 @@ void checkDoTransformUpdate() {
i++;
}

vars.release();

for (int j = i; j >= 0; j--) {
rootNode = stack[j];
// Clear stack to avoid memory leaks
// (Spatials added to the stack might get detached from their parent
// after this method has been called -> they and their OGL object will not
// get garbage collected when subsequent calls to checkDoTransformUpdate()
// require only smaller stacks)
stack[j] = null;
//rootNode.worldTransform.set(rootNode.localTransform);
//rootNode.worldTransform.combineWithParent(rootNode.parent.worldTransform);
//rootNode.refreshFlags &= ~RF_TRANSFORM;
rootNode.updateWorldTransforms();
}

vars.release();
}
}

Expand Down
11 changes: 9 additions & 2 deletions jme3-core/src/main/java/com/jme3/util/ListSort.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*/
package com.jme3.util;

import java.util.Arrays;
import java.util.Comparator;

/**
Expand Down Expand Up @@ -240,8 +241,14 @@ public void sort(T[] array, Comparator<T> comparator) {
}

// Merge all remaining runs to complete sort
mergeForceCollapse();

mergeForceCollapse();

// Clear temporary array to avoid memory leaks
// (e.g. Geometries added to the array by GeometryList#sort() might get
// detached from their parent later -> they and their OGL object will not
// get garbage collected when subsequent sorts use only portions of the
// array)
Arrays.fill(tmpArray, null);
}

/**
Expand Down
Loading