Closed
Description
Created by: WhiteSte
I'm referring to #199, i'm using the last version (4.05a)
Description
I'm supposing that the method unregisterMethod from PApplet class is not working at all.
Expected Behavior
After loading a method inside PApplet it should be removed.
Current Behavior
Methods seems to me that are not removed.
Steps to Reproduce
SKETCH
TestObject test;
void setup() {
test = new TestObject(this, "object 1");
test.remove();
}
void draw() {
if (frameCount == 10) {
exit();
}
}
CLASS
public class TestObject {
private PApplet parent;
private String name;
private boolean flag = false;
public TestObject(PApplet parent, String name) {
this.parent = parent;
this.name = name;
parent.registerMethod("post", this);
}
public void post() {
if (flag == true) System.out.println("You should have removed this Method");
System.out.println("Running: " + name);
this.remove(); // That should stop spamming in console
flag = true;
}
public void remove(){
System.out.println("Removing: " + name);
parent.unregisterMethod("post", name);
}
}
Your Environment
- Processing version: 4.05alpha
- Operating System and OS version: Mac os latest version Big Sur 11.4
- Other information:
Possible Causes / Solutions
I saw that a modification to this method was made some weeks ago, maybe that's the cause
Metadata
Metadata
Assignees
Labels
No labels