aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-core/src
diff options
context:
space:
mode:
authorJulien Gouesse <[email protected]>2014-07-13 19:09:08 +0200
committerJulien Gouesse <[email protected]>2014-07-13 19:09:08 +0200
commit7d9f921b106e507341accbda3934354dca8f713d (patch)
treebc572ff3a658db2319ca3e08a338ffd280a4f7f9 /ardor3d-core/src
parent9a193c7784a1f9ff3ab2f7fa5688c17d681aae50 (diff)
Avoids a NullPointerException in the texture manager when the deleter is null and adds a few override annotations
Diffstat (limited to 'ardor3d-core/src')
-rw-r--r--ardor3d-core/src/main/java/com/ardor3d/util/TextureManager.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/TextureManager.java b/ardor3d-core/src/main/java/com/ardor3d/util/TextureManager.java
index 8a39852..b584647 100644
--- a/ardor3d-core/src/main/java/com/ardor3d/util/TextureManager.java
+++ b/ardor3d-core/src/main/java/com/ardor3d/util/TextureManager.java
@@ -50,6 +50,7 @@ final public class TextureManager {
static {
ContextManager.addContextCleanListener(new ContextCleanListener() {
+ @Override
public void cleanForContext(final RenderContext renderContext) {
TextureManager.cleanAllTextures(null, renderContext, null);
}
@@ -438,9 +439,12 @@ final public class TextureManager {
private static void handleTextureDelete(final Renderer deleter, final Multimap<Object, Integer> idMap,
final Map<Object, Future<Void>> futureStore) {
+ if (deleter == null) {
+ return;
+ }
Object currentGLRef = null;
// Grab the current context, if any.
- if (deleter != null && ContextManager.getCurrentContext() != null) {
+ if (ContextManager.getCurrentContext() != null) {
currentGLRef = ContextManager.getCurrentContext().getGlContextRep();
}
// For each affected context...
@@ -453,6 +457,7 @@ final public class TextureManager {
else {
final Future<Void> future = GameTaskQueueManager.getManager(ContextManager.getContextForRef(glref))
.render(new RendererCallable<Void>() {
+ @Override
public Void call() throws Exception {
getRenderer().deleteTextureIds(idMap.get(glref));
return null;