If either CreateThread() or _beginthreadex() fails then we should deallocate the instance of ThreadFunctionInvocation we created.
Created attachment 77857 [details]
Don't we have a cleaner way to do this?
(In reply to comment #2)
> Don't we have a cleaner way to do this?
One idea was to use OwnPtr, but I was concerned that there might be a race condition between the time we copy the data structure pointed to by param in wtfThreadEntryPoint() and when the OwnPtr goes out of scope when we reach the end of createThreadInternal().
I'll look into this some more. If you have any insight/suggestions I would appreciate it.
Created attachment 77904 [details]
Use OwnPtr based on a suggestion by Adam Roben for bug #51855
Created attachment 77905 [details]
Committed r74983: <http://trac.webkit.org/changeset/74983>