Does Workbook need to be disposed of after use?

In reference to this thread: Aspose.cells.workbook does not implement System.IDisposable


It seems that in previous version of Aspose.Cells, Workbook does not implements IDisposable, but in current version (8.6.1.0), it does implements IDisposable.

In the referenced thread above, one of the comment was “Workbook object does not use any unmanaged resources and it is purely .NET object.”, if this is true, why does it now implements IDisposable? Are there resources that needs to be disposed of in the current version?

Reason why I’m asking is because my logic may change depending on whether or not Workbook needs to be disposed of. For example, I may need to expect ObjectDisposedException, or if it needs to be disposed I may store it in memory as a byte array instead of a reference to Workbook…etc…

Thanks,
Minh

Hi Minh,

Thanks for your posting and using Aspose.Cells.

Workbook is a pure .NET object, it does not use any unmanaged resources, so you do not need to dispose it of. However, we implemented IDisposable on some user request, because he needs us to implement this method for his own application logic. So this is just an empty method and does not have any real thing inside it.

Please check this thread for your reference.

( Aspose.cells.workbook does not implement System.IDisposable )