-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calls to unregisterMethod may not work #223
Comments
Created by: benfry Found the problem; looking into it. |
Created by: benfry Fixed for alpha 6. There are a couple bugs in your test case—it's removing the name of the object not the object itself (change 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: " + this);
this.remove(); // That should stop spamming in console
flag = true;
}
public void remove() {
System.out.println("Removing: " + this);
parent.unregisterMethod("post", this);
}
} You're also removing the method before it has a chance to actually run… i.e. You're adding and then removing the |
Created by: WhiteSte
Yep the idea was that post() should never run because i was adding and removing at the "same time". I'm not a real programmer so it was just a demo to make the idea. Btw, thanks for the fix, do you have an idea of a date for release 6 or do you think it could work if i download the actual code and then make by myself the jar files? |
Created by: benfry Yeah, it's not a critique of your code—just trying to help. |
Created by: github-actions[bot] This issue has been automatically locked. To avoid confusion with reports that have already been resolved, closed issues are automatically locked 30 days after the last comment. Please open a new issue for related bugs. |
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
CLASS
Your Environment
Possible Causes / Solutions
I saw that a modification to this method was made some weeks ago, maybe that's the cause
The text was updated successfully, but these errors were encountered: