Could "function" be disposed immediately after the call, like this:

```csharp
if (function != null)
{
    using(function)
        function.Call();
    function = null;
}
```