mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 06:53:27 +02:00
[Bug] Fix memory leak in egg hatch (#6511)
Co-authored-by: MokaStitcher <54149968+MokaStitcher@users.noreply.github.com>
This commit is contained in:
parent
7001f78beb
commit
344e9463cc
@ -230,6 +230,7 @@ export class EggHatchPhase extends Phase {
|
|||||||
} else {
|
} else {
|
||||||
globalScene.time.delayedCall(250, () => globalScene.setModifiersVisible(true));
|
globalScene.time.delayedCall(250, () => globalScene.setModifiersVisible(true));
|
||||||
}
|
}
|
||||||
|
this.pokemon?.destroy();
|
||||||
super.end();
|
super.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,10 @@ export class EggSummaryPhase extends Phase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
end() {
|
end() {
|
||||||
|
this.eggHatchData.forEach(data => {
|
||||||
|
data.pokemon?.destroy();
|
||||||
|
});
|
||||||
|
this.eggHatchData = [];
|
||||||
globalScene.time.delayedCall(250, () => globalScene.setModifiersVisible(true));
|
globalScene.time.delayedCall(250, () => globalScene.setModifiersVisible(true));
|
||||||
globalScene.ui.setModeForceTransition(UiMode.MESSAGE).then(() => {
|
globalScene.ui.setModeForceTransition(UiMode.MESSAGE).then(() => {
|
||||||
super.end();
|
super.end();
|
||||||
|
Loading…
Reference in New Issue
Block a user