在调试App时打开Xcode内存图工具,发现有循环引用

由上图可得:
SectionTrace对象->SectionDayTracesGroupHeader对象->通过闭包ignore.context->SectionTrace对象
同样有
SectionTrace对象->SectionDayTracesGroupHeader对象->通过闭包evaluate.context->SectionTrace对象
即SectionTrace和SectionDayTracesGroupHeader对象被2条线牢牢锁住,无法被释放!
打开SectionDayTracesGroupHeader类,看一下
class SectionDayTracesGroupHeader:HeaderFooterViewRepresentable{
typealias HandleType = (Date)->()