COM CleanUp when using IXSSO in .Net

I am using IXSSO to access Index Server similar to described in  article  Query Index Server with IXSSO in .NET” on  ASP101. (See also my post how to use Fill Dataset with rows in a specified range

Recently I found a useful tip to dispose COM objects after the use. I noticed that  it is required to check for null before calling ReleaseComObject. So the finally section should be like this



// recommended in

if (rs!=null)Marshal.ReleaseComObject(rs); //Recordset

if (query!=null)Marshal.ReleaseComObject(query); //Query

if (util!=null)Marshal.ReleaseComObject(util); //Utils

query = null;

util =