Bug 51860

Summary: LEAK: Deallocate instance of ThreadFunctionInvocation if thread creation fails
Product: WebKit Reporter: Daniel Bates <dbates>
Component: Web Template FrameworkAssignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, eric
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
Patch
none
Patch
none
Patch aroben: review+

Daniel Bates
Reported 2011-01-03 18:06:17 PST
If either CreateThread() or _beginthreadex() fails then we should deallocate the instance of ThreadFunctionInvocation we created.
Attachments
Patch (1.65 KB, patch)
2011-01-03 18:08 PST, Daniel Bates
no flags
Patch (1.84 KB, patch)
2011-01-04 10:46 PST, Daniel Bates
no flags
Patch (2.43 KB, patch)
2011-01-04 10:49 PST, Daniel Bates
aroben: review+
Daniel Bates
Comment 1 2011-01-03 18:08:01 PST
Eric Seidel (no email)
Comment 2 2011-01-03 23:44:44 PST
Don't we have a cleaner way to do this?
Daniel Bates
Comment 3 2011-01-03 23:53:57 PST
(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.
Daniel Bates
Comment 4 2011-01-04 10:46:58 PST
Created attachment 77904 [details] Patch Use OwnPtr based on a suggestion by Adam Roben for bug #51855
Daniel Bates
Comment 5 2011-01-04 10:49:35 PST
Daniel Bates
Comment 6 2011-01-04 11:29:55 PST
Note You need to log in before you can comment on or make changes to this bug.