Merge pull request #91123 from aaronp64/multi_viewport_crash
Fix `SubViewport`/`AudioStreamPlayer2D` crash
This commit is contained in:
commit
a8337da037
1 changed files with 3 additions and 0 deletions
|
@ -5048,6 +5048,9 @@ Viewport::~Viewport() {
|
||||||
for (ViewportTexture *E : viewport_textures) {
|
for (ViewportTexture *E : viewport_textures) {
|
||||||
E->vp = nullptr;
|
E->vp = nullptr;
|
||||||
}
|
}
|
||||||
|
if (world_2d.is_valid()) {
|
||||||
|
world_2d->remove_viewport(this);
|
||||||
|
}
|
||||||
ERR_FAIL_NULL(RenderingServer::get_singleton());
|
ERR_FAIL_NULL(RenderingServer::get_singleton());
|
||||||
RenderingServer::get_singleton()->free(viewport);
|
RenderingServer::get_singleton()->free(viewport);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue