diff options
author | Alistair Leslie-Hughes <leslie_alistair@hotmail.com> | 2023-11-13 16:21:59 +1100 |
---|---|---|
committer | Alistair Leslie-Hughes <leslie_alistair@hotmail.com> | 2023-11-14 07:34:41 +1100 |
commit | a30dc67007e91d4a264c136459eebf262bf0c6b2 (patch) | |
tree | bfe958e2af1e2bd5beea071daaa195dea462eccc /scene/resources/visual_shader.cpp | |
parent | 59457685c18e2d729eea50c751c11f049a7186f0 (diff) | |
download | redot-engine-a30dc67007e91d4a264c136459eebf262bf0c6b2.tar.gz |
Fix VisualShader connection use after free.
Diffstat (limited to 'scene/resources/visual_shader.cpp')
-rw-r--r-- | scene/resources/visual_shader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 69925fc19f..423ef3867f 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -963,13 +963,13 @@ void VisualShader::remove_node(Type p_type, int p_id) { for (List<Connection>::Element *E = g->connections.front(); E;) { List<Connection>::Element *N = E->next(); if (E->get().from_node == p_id || E->get().to_node == p_id) { - g->connections.erase(E); if (E->get().from_node == p_id) { g->nodes[E->get().to_node].prev_connected_nodes.erase(p_id); g->nodes[E->get().to_node].node->set_input_port_connected(E->get().to_port, false); } else if (E->get().to_node == p_id) { g->nodes[E->get().from_node].next_connected_nodes.erase(p_id); } + g->connections.erase(E); } E = N; } |