mirror of
https://github.com/Stefan-5422/School-Programming-Projekt-022022.git
synced 2026-09-04 08:56:01 +02:00
Set references null on destroy
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user