Skip to content

Commit fceee58

Browse files
committed
fix issue #997 (cloning UpdateControl throws IllegalArgumentException)
1 parent 000ac95 commit fceee58

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

jme3-core/src/main/java/com/jme3/scene/control/UpdateControl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2018 jMonkeyEngine
2+
* Copyright (c) 2009-2019 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -54,7 +54,7 @@
5454
*/
5555
public class UpdateControl extends AbstractControl {
5656

57-
private final ConcurrentLinkedQueue<AppTask<?>> taskQueue = new ConcurrentLinkedQueue<AppTask<?>>();
57+
private ConcurrentLinkedQueue<AppTask<?>> taskQueue = new ConcurrentLinkedQueue<>();
5858

5959
/**
6060
* Enqueues a task/callable object to execute in the jME3
@@ -87,6 +87,7 @@ protected void controlRender(RenderManager rm, ViewPort vp) {
8787
@Override
8888
public Object jmeClone() {
8989
UpdateControl clone = (UpdateControl)super.jmeClone();
90+
clone.taskQueue = new ConcurrentLinkedQueue<>();
9091

9192
// This is kind of questionable since the tasks aren't cloned and have
9293
// no reference to the new spatial or anything. They'll get run again

0 commit comments

Comments
 (0)