CALayer as SCNMaterial content memory leak

With code below, when scene is set to nil, I expected CALayer to deallocate. but it doesn't


Has anyone encountered this problem? Is there something I'm missing?


Code Link :

gist: https://gist.github.com/ohbargain/8c71703c76623d75ee8c64be74a5f572



Replies

Did you ever find a solution or workaround for this problem? I realize it's 3+ years later but I'm having this problem with the latest iOS versions, 12.1.1 and 12.2.