Summary: | Leak in WebSocketChannel with workers/worker-reload.html | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yuta Kitamura <yutak> | ||||||
Component: | WebCore Misc. | Assignee: | Yuta Kitamura <yutak> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | levin, levin+threading, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Yuta Kitamura
2012-04-05 18:42:42 PDT
And my comment: Comment 3 by yutak@chromium.org, Today (21 minutes ago) This is related to http://trac.webkit.org/changeset/113138 A speculative fix is on the way; I think I just need to make mainThreadDestroy() a cleanup task so that it won't get lost during main thread's cleanup period. Created attachment 135966 [details]
Patch
Comment on attachment 135966 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=135966&action=review > Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp:579 > + virtual ~MainThreadDestroyTask() { } Why is this needed? > Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp:586 > + virtual bool isCleanupTask() const OVERRIDE { return true; } Even better, make WorkerThreadableWebSocketChannel::Peer*, OwnPtr<WorkerThreadableWebSocketChannel::Peer> instead and don't delete m_peer explicitly just let the destructor do it. You could even get rid of this class and just do OwnPtr<Peer> peer = m_peer; m_peer = 0; m_loaderProxy.postTaskToLoader(MainThreadDestroyTask::create(peer.release())); in void WorkerThreadableWebSocketChannel::Bridge::disconnect() and make You may need to make WorkerThreadableWebSocketChannel::mainThreadDestroy take a PassOwnPtr. and put in a comment that this method is there just to allow peer to get deleted and even if it doesn't run, the destructor for the callbacktask will delete it. Created attachment 135980 [details]
Patch v2
Bonus point for getting rid of AllowCrossThreadAccess in one place. :) Comment on attachment 135980 [details]
Patch v2
Thanks!
Comment on attachment 135980 [details] Patch v2 Clearing flags on attachment: 135980 Committed r113414: <http://trac.webkit.org/changeset/113414> All reviewed patches have been landed. Closing bug. |