[Python.NET] calling Finalize directly

Brian Lloyd brian at zope.com
Thu May 12 16:54:52 CEST 2005

> I realize that you cannot currently build on mono
> due to other limitations, but it seems that mcs also
> does not like the fact that you call Finalize()
> directly in some cases.
> The MS compiler does not complain, although on
> MSDN it says not to do this, and to use Dispose()
> instead.  Is there any reason why you call
> Finalize() directly?

All of the Finalize methods that are called directly are static 
methods (e.g., they are *not* destructor aliases and unrelated to 
the Dispose pattern). They match (also static) Initialize() methods for 
a few classes in the runtime that can't rely on static constructors 
(because they need to be run in a specific order).

So I suspect that mcs is wrong in this case, but I'm not a CLI 
laywer ;) Does mcs give you an error, or just a warning?

Brian Lloyd        brian at zope.com
V.P. Engineering   540.361.1716              
Zope Corporation   http://www.zope.com 

More information about the PythonDotNet mailing list