[Webkit-unassigned] [Bug 32827] New: Make it unnecessary for clients to call DestroyWindow on a WebView

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 21 10:15:36 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=32827

           Summary: Make it unnecessary for clients to call DestroyWindow
                    on a WebView
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Other
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit API
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: aroben at apple.com



Adam Roben (aroben) <aroben at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #45337|                            |review?
               Flag|                            |


Created an attachment (id=45337)
 --> (https://bugs.webkit.org/attachment.cgi?id=45337)
Patch

WebKit clients can currently cleanly get rid of a WebView in two ways.
A)
1) DestroyWindow(webViewHWND)
2) webView->Release()
B)
1) webView->close()
2) DestroyWindow(webViewHWND) (can be swapped with (1))
3) webView->Release()

We'd like clients to be able to get rid of a WebView just by releasing
the last reference to it. This patch gets us a little closer to that
by removing step B2 above (though calling DestroyWindow in this case
is harmless). A future patch will make steps A1 and B1 unnecessary, as
well.

Fixes <rdar://problem/7374218> Crash in WebView::updateActiveState
when closing "Welcome to iTunes" window

Reviewed by NOBODY (OOPS!).

* WebView.cpp:
(WebView::~WebView): Call setIsBeingDestroyed() so that we won't be
ref'd by our WndProc, which would result in this destructor being
re-entered.
(WebView::close): Moved the call to revokeDragDrop here...
(WebView::WebViewWndProc): ...from here. This is important in order to
release the reference that OLE holds while we're registered as a drop
target. Otherwise, clients that call IWebView::close but not
DestroyWindow would leak the WebView.

* WebView.h:
(WebView::setIsBeingDestroyed):
(WebView::isBeingDestroyed):
Made these private, and added a comment about what isBeingDestroyed()
now means.
---
 3 files changed, 52 insertions(+), 5 deletions(-)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list