Quantcast
Channel: Classic ASP
Viewing all articles
Browse latest Browse all 488

Class termination problem after October 2019 update

$
0
0

After October 2019 updates, it seems that the class termination has changed behavior, when you call an class inside an other class

<%
Class myClass
Private Sub Class_Initialize()
Response.Write "myClass Initialized<br>"
End Sub
Private Sub Class_Terminate()
Response.Write "myClass Terminated<br>"
End Sub

Public Function TestFnc()
TestFnc = "1<br>"
End Function
End Class

Class myOtherClass
Private Sub Class_Initialize()
Response.Write "myOtherClass Initialized<br>"
End Sub
Private Sub Class_Terminate()
Response.Write "myOtherClass Terminated<br>"
End Sub
Sub MainSub()
Dim myClassObj
Set myClassObj = New myClass
Response.Write myClassObj.TestFnc
Set myClassObj = Nothing
Response.Write "2<br>"
Set myClassObj = New myClass
Response.Write myClassObj.TestFnc
Set myClassObj = Nothing
Response.Write "3<br>"
End Sub
End Class

Dim myObj
Set myObj = New myOtherClass
Call myObj.MainSub
Set myObj = Nothing
%>


Before the update the result is:

myOtherClass Initialized
myClass Initialized
1
myClass Terminated
2
myClass Initialized
1
myClass Terminated
3
myOtherClass Terminated

After October update:

myOtherClass Initialized
myClass Initialized
1
2
myClass Initialized
1
3
myClass Terminated
myClass Terminated
myOtherClass Terminated

As you can see, the termination of myClass happens with the termination of the myOtherClass.

I think that is a serious Microsoft bug.

Domus71

P.S. I think that the KB4520724 Servicing Stack Update causes this strange behavior.


Viewing all articles
Browse latest Browse all 488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>