kellyethridge / VBCorLib

The VBCorLib framework brings many of the powerful .NET classes to VB6.
http://www.kellyethridge.com/vbcorlib/
MIT License
112 stars 28 forks source link

APPCRASH after app exit if CorString.Trim() function used. #108

Open melanysoft opened 10 months ago

melanysoft commented 10 months ago

I'm submitting a bug report

Library Version: 3.2.0

Please tell us about your environment:

Windows 10

Code being run in the ActiveX dll:

Public Function TrimForJSON(ByVal Text As String, Optional ByVal TrimChars As String) As String

        On Error GoTo errhndl

        If TrimChars = vbNullString Then TrimChars = " " & vbTab & vbCrLf & vbLf
        TrimForJSON = CorString.Trim(Text, TrimChars)

Exit Function

There is appcrash report in the EventViewer that I can send if you thing there may be anything usefull in it.

During start program calls TrimForJSON("{"appver":"245.23","dbver":"1929"}") and everything seems fine. But when the app is terminated some time later it crashes instead of closing gracefully. If the line:

TrimForJSON = CorString.Trim(Text, TrimChars)

is replaced by:

TrimForJSON = Text

app closes quietly (no error, no crash).