>>>Yes, C# is the only language in Visual Studio.NET to fully cater for the CLR including all the exposed types. Beta 2 will apparently expose a lot more functionality including a solution to the non-deterministic destructor thing.
>>
>>What is a non-deterministic destructor thing?
>
>PMFJI, but I believe it has to with how CLR destroys it's objects. When you create a COM object, an internal call is made to the internal method AddRef(). A counter is incremented when you intially create the object and each time it is assigned to a variable. Ex.
>
>ox = createobject('myobject')
>oy = ox
>
>The internal count is 2. When you release oy the count is decremented and so on. When the last reference to the object is released, the destructor is initiated and the object finally goes away. With VFP and VB (currently), the destructor fires immediately upon the last object reference going away.
>
>With .NET that doesn't happen. A background garbage collection thread continually runs and checks object references. If it finds that the internal count is 0, it initiates the destructor. Depending on the priority of the garbage collectino thread and the use of the object, resources it holds could still be in use after all objects have been released and it could lead you into problems.
>
>HTH.
Good explanation. Thanks.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement