You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If there is a static variable within a class, it ends up outliving the instance, which may then lead to crashes in IDE and strange behaviors in VBx.
To Reproduce
Create a project and add the following code:
Private Class WhatIs
Public Function IsTheNumber() As Long
Static i As Long
i += 1
Return i
End Function
End Class
Private Module Who
Public Sub Colombo()
With New WhatIs
Debug.Print .IsTheNumber
End With
End Sub
Public Sub Holmes()
With New WhatIs
Debug.Print .IsTheNumber
End With
End Sub
Public Sub Dunnit()
Colombo
Holmes
End Sub
End Module
Run the Who.Dunnit
Observe the debug console output. Repeat few times and you will see it continue to increase when it should have had reset.
Expected behavior
The static variable should be reset and be independent between instances.
Screenshots
Desktop (please complete the following information):
OS: Windows 10
twinBASIC IDE Beta 46
The text was updated successfully, but these errors were encountered:
Describe the bug
If there is a static variable within a class, it ends up outliving the instance, which may then lead to crashes in IDE and strange behaviors in VBx.
To Reproduce
Who.Dunnit
Expected behavior
The static variable should be reset and be independent between instances.
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: