forked from bartvdbraak/blender
Fix for #28980, could enter infinite loop during node socket verification if dynamic sockets are present.
Note: in this particular bug report the sockets have some faulty flag settings (none of them should be flagged as SOCK_DYNAMIC), needs more info.
This commit is contained in:
parent
36017e2af9
commit
70ba7d02db
@ -405,15 +405,15 @@ static bNodeSocket *verify_socket_template(bNodeTree *ntree, bNode *node, int in
|
||||
|
||||
static void verify_socket_template_list(bNodeTree *ntree, bNode *node, int in_out, ListBase *socklist, bNodeSocketTemplate *stemp_first)
|
||||
{
|
||||
bNodeSocket *sock;
|
||||
bNodeSocket *sock, *nextsock;
|
||||
bNodeSocketTemplate *stemp;
|
||||
|
||||
/* no inputs anymore? */
|
||||
if(stemp_first==NULL) {
|
||||
while(socklist->first) {
|
||||
sock = (bNodeSocket*)socklist->first;
|
||||
for (sock = (bNodeSocket*)socklist->first; sock; sock=nextsock) {
|
||||
nextsock = sock->next;
|
||||
if (!(sock->flag & SOCK_DYNAMIC))
|
||||
nodeRemoveSocket(ntree, node, socklist->first);
|
||||
nodeRemoveSocket(ntree, node, sock);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -424,10 +424,10 @@ static void verify_socket_template_list(bNodeTree *ntree, bNode *node, int in_ou
|
||||
stemp++;
|
||||
}
|
||||
/* leftovers are removed */
|
||||
while(socklist->first) {
|
||||
sock = (bNodeSocket*)socklist->first;
|
||||
for (sock = (bNodeSocket*)socklist->first; sock; sock=nextsock) {
|
||||
nextsock = sock->next;
|
||||
if (!(sock->flag & SOCK_DYNAMIC))
|
||||
nodeRemoveSocket(ntree, node, socklist->first);
|
||||
nodeRemoveSocket(ntree, node, sock);
|
||||
}
|
||||
|
||||
/* and we put back the verified sockets */
|
||||
|
Loading…
Reference in New Issue
Block a user