Jump to content

Generic Thread Close Error


Recommended Posts

I'm getting the really generic error of

>Running:(3.2.8.1):J:\Dev\AutoIt3\autoit3.exe "J:\Dev\Programs\DarknessRising\DarknessRising.au3"   
Error in my_thread_global_end(): 7 threads didn't exit
+>00:57:23 AutoIT3.exe ended.rc:0

Here's my load function

func load()
       $MySQLObj = _MySQLConnect ($sUsername, $sPassword, $sServer, $sDatabase, $CPU_arch)
    If @error = 1 Then
        Console("Error opening SQL connection - " & @error, 1)
    ElseIf @error = 2 Then
        Console("MySQL ODBC Driver not installed - " & @error, 1)
    EndIf
endfunc

Here's my end function

Func end($bCloseSockets = True, $iExitCode = 0)
    If $bCloseSockets Then
        TCPCloseSocket($hListenSocket)
        For $i = 0 To $N_MAXSOCKETS - 1
            _ASockShutdown ($hSockets[ $i ])
        Next
        Sleep($N_WAITCLOSE)
        For $i = 0 To $N_MAXSOCKETS - 1
            TCPCloseSocket($hSockets[ $i ])
        Next
        Console("Open Sockets Closed." & " -Line-" & @ScriptLineNumber, 1)
    EndIf
    DllClose($hDllAsync)
    Console("DLL connection closed." & " -Line-" & @ScriptLineNumber, 1)
    TCPShutdown()
    If @error Then
        Console("Unable to close TCP connection." & " -Line-" & @ScriptLineNumber, 1)
    EndIf
    $g_bExecExit = False
    Console("Before _MySQLEnd", 1)
    _MySQLEnd ($MySQLObj)
    If @error Then
        Console("SQL object lost." & " -Line-" & @ScriptLineNumber, 1)
    EndIf
    Console("After _MySQLEnd", 1)
    Console("Exit Completed" & " -Line-" & @ScriptLineNumber, 1)
    FileClose($debugfile)
    FileClose($logfile)
        Exit
EndFunc ;==>end

and here is the log file

11/03/2007 - 01:14:12 Debug enabled -Line-241
11/03/2007 - 01:14:12 Logging enabled
11/03/2007 - 01:14:13 Fetching  remote IP
11/03/2007 - 01:14:13 Loading local client list.
11/03/2007 - 01:14:14 192.168.1.116
11/03/2007 - 01:14:14 Have begun to listen on port 31337, INADDR_ANY. Waiting... -Line-290
11/03/2007 - 01:14:14 Gui Created -Line-83
11/03/2007 - 01:14:15 Exit Initiated -Line-208
11/03/2007 - 01:14:17 Open Sockets Closed. -Line-183
11/03/2007 - 01:14:17 DLL connection closed. -Line-186
11/03/2007 - 01:14:17 Before _MySQLEnd
11/03/2007 - 01:14:17 After _MySQLEnd
11/03/2007 - 01:14:17 Exit Completed -Line-198

Keep in mind that the program isn't randomly crashing. I get this error after I initiate the end function. Any ideas on what is going on?

Edited by shadesdude
Link to comment
Share on other sites

I still can't figure this out. As far as I can tell all my objects are in fact objects and all running stuff is being closed properly.

One more bit of info, when I compile the program and close it I receive a pop up saying Avector[] out of bounds. But I kind of assume that is the same error just being redirected to a message box.

Link to comment
Share on other sites

Anything at all guys? I've debugged every line and the only errors out of the entire script are from

If $bCloseSockets Then
        TCPCloseSocket($hListenSocket)
        For $i = 0 To $N_MAXSOCKETS - 1
            _ASockShutdown ($hSockets[ $i ])
            If @error Then
                Console("Error closing ASock " & $hSockets[ $i ] & " - error - " & @error & " -Line-" & @ScriptLineNumber, 1)
            EndIf
        Next
        Sleep($N_WAITCLOSE)
        For $i = 0 To $N_MAXSOCKETS - 1
            TCPCloseSocket($hSockets[ $i ])
            If @error Then
                Console("Error closing Sock " & $hSockets[ $i ] & " - error - " & @error & " -Line-" & @ScriptLineNumber, 1)
            EndIf
        Next
        Console("Open Sockets Closed." & " -Line-" & @ScriptLineNumber, 1)
    EndIf

which makes sense because I'm forcing a close on unopened sockets. Gives error 10038 which is "socket not an object" again that is expected. And if I skip this code I still receive the same thread did not close error. I've also made sure that all objects are properly being closed as well as DLL's. I'm running on both a 64 bit and 32 bit XP system. I guess at this point even suggestions on debugging would be greatly appreciated.

Link to comment
Share on other sites

  • 2 weeks later...

Not to bring up an old topic, but it looks like your using the Asock library made by Zatorg, which is built using DLL calls. I haven't researched out all those calls yet, but I'm willing to bet that, with the newest beta/release changing how some DLLCall() stuff works, his library might be broken as is. I'm planning on hunting down some documentation to the calls he uses soon (MSDN), so I'll try to let you know if I ever come up with something on that part of it.

I use it too, and I've never gotten an error like that, but then again, I'm not using it in tandem with mySQL either.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...