来至研发的回复:
Font object might be used by more than one cell. Even other element (header, conditional format…) may use the Font too.
It’s better not to dispose manually. By design of GDI+’s Font, if it isn’t used by any object, the font will be collected and disposed automatically.
In ChangeFont function, he just remove the following code:
If(hasCellFont)
cellFont.Dispose();
In case he need to collect memory and release resource, call Gc.Collect(). All unused Font objects will be disposed.
SpreadDesigner并非实际产品,只是示例参考代码,再次建议您不要直接用于实际项目开发。更多SpreadDesigner代码问题,如果不直接影响效果展示,我们不会进行健壮性维护。
谢谢! |