Set references null on destroy

This commit is contained in:
Stone_Red
2022-05-07 14:23:07 +02:00
parent a297661118
commit 6867f4ec10
2 changed files with 4 additions and 0 deletions
@@ -65,5 +65,7 @@ public class OfferBehaviour extends Component {
public void destroy() {
this.parent.removeListener("itemAccepted", this, this::itemAccepted);
this.parent.removeListener("placed", this,this::placed);
receiver = null;
}
}
@@ -58,6 +58,8 @@ public class RecieveBehaviour extends Component {
public void destroy() {
this.parent.removeListener("offerItem", this, this::receive);
this.parent.removeListener("placed", this, this::placed);
offerer = null;
}
}