After writing about Code Snippets, I thought it is time to publish one myself.
Description: | It’s a Code Snippet for releasing a COM object. It first checks, if the object really is a COM object then releases it. |
Shortcut: | rco |
Result: | if ( (MyObject !=null) && (Marshal.IsComObject(MyObject)) ) { Marshal.ReleaseComObject(MyObject); } |
Download: | ReleaseComObject.snippet |