I noticed that after disposing the spire object , it seems the spire doc object is not null.
Is this correct and how do i know whether the spire doc object is not valid anymore or disposed?
Here is the sample code im using for testing:
- Code: Select all
Document document = null;
try
{
document = new Document();
document.LoadFromFileInReadMode(tbPath.Text, Spire.Doc.FileFormat.Auto);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
// Console.WriteLine(ex.Message);
}
finally
{
try
{
if (document != null)
{
document.Dispose();
}
}
catch (Exception ex)
{
}
}
Before dispose
After dispose