child is already inserted in a tree

Assertion 'child->_nextSibling == NULL' failed. child is already inserted in a tree Assertion 'child->_parent == NULL' failed. child is already inserted in a tree

These messages began to appear recently in a code that has been 'working' for many years. I guess that I must have done something wrong, but I do not know where to start looking to see why this error is occurring.

I guess it has something to do with SCNode and Scene Kit, but any pointers would be gratefully received.

The two messages may repeat 20-200 times while launching, and occasionally the program hangs.

Advice on the net is to create a cut down version prior to creating a TSI. Easier said than done, given that this is a large program. And somehow one is supposed to reduce the problem to <250 lines which seems utterly infeasible in this case. Nevertheless, some days and many hours later, the program is vastly reduced, but still there are >150 files to comb through.

The useful outcome of this work however is that I can characterise the 'phenomonology' that surrounds the appearance of these message strings. Sometimes after a rebuild, the cut down program must be launched sequentially several times before the messages begin once again to appear. I suppose therefore that somewhere in the program worker threads are launched that SceneKit cannot manage properly, or that there is something I am doing that prepares the ground for thread conflict. I do not know.

child is already inserted in a tree
 
 
Q