Destructors are not guaranteed to be called, simply because the Garbage Collector ( by default ) runs when it wants to and your program may finish before the destructor is called.
If you force collection as in above, you'll see it gets called. But you should not rely on destructors for the reason I explained above.
Type Ttest Method New() Print "constructor was called" End Method Method Delete() Print "destructor was called" End Method End Type Local a:Ttest = New Ttest a = Null GCCollect
If you force collection as in above, you'll see it gets called. But you should not rely on destructors for the reason I explained above.