Skip to content

内存泄露 #2

@ghost

Description

1.存在严重的内存泄露。ChartView 滑动时存在线性的内存增长。
ZYWCandleChartView.m
CGMutablePathRef redRef = CGPathCreateMutable();
CGMutablePathRef greenRef = CGPathCreateMutable();
这个需要手动释放。
// add
CGPathRelease(redRef);
CGPathRelease(greenRef);

2.浏览了代码,思路是在scrollview上放置ChartView。
这样做是有问题的,数据不断增长,ChartView的宽度可以无限变大。

3.可以只绘制当前界面需要显示的K线,减少不必要的开销。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions