Title: [104409] trunk/Source/WebKit2
- Revision
- 104409
- Author
- [email protected]
- Date
- 2012-01-08 13:44:52 -0800 (Sun, 08 Jan 2012)
Log Message
REGRESSION (r103859): WKViews leak
https://bugs.webkit.org/show_bug.cgi?id=75805
The flags changed event monitor added in r103859 was retaining the WKView (as it references
self in the handler block), causing it to leak.
* UIProcess/API/mac/WKView.mm:
(-[WKView dealloc]): Moved call to remove the flags changed event monitor from here...
(-[WKView viewDidMoveToWindow]): ...to here. Moved call to add the flags changed event
monitor to here from...
(-[WKView initWithFrame:contextRef:pageGroupRef:]): ...here.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (104408 => 104409)
--- trunk/Source/WebKit2/ChangeLog 2012-01-08 21:33:43 UTC (rev 104408)
+++ trunk/Source/WebKit2/ChangeLog 2012-01-08 21:44:52 UTC (rev 104409)
@@ -1,3 +1,17 @@
+2012-01-08 Dan Bernstein <[email protected]>
+
+ REGRESSION (r103859): WKViews leak
+ https://bugs.webkit.org/show_bug.cgi?id=75805
+
+ The flags changed event monitor added in r103859 was retaining the WKView (as it references
+ self in the handler block), causing it to leak.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView dealloc]): Moved call to remove the flags changed event monitor from here...
+ (-[WKView viewDidMoveToWindow]): ...to here. Moved call to add the flags changed event
+ monitor to here from...
+ (-[WKView initWithFrame:contextRef:pageGroupRef:]): ...here.
+
2012-01-06 Mark Rowe <[email protected]>
REGRESSION (WebKit2): Save as PDF no longer generates links to URLs
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (104408 => 104409)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2012-01-08 21:33:43 UTC (rev 104408)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2012-01-08 21:44:52 UTC (rev 104409)
@@ -225,7 +225,6 @@
- (void)dealloc
{
_data->_page->close();
- [NSEvent removeMonitor:_data->_flagsChangedEventMonitor];
ASSERT(!_data->_inSecureInputState);
@@ -1823,12 +1822,20 @@
_data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible | WebPageProxy::ViewIsInWindow);
[self _updateWindowVisibility];
[self _updateWindowAndViewFrames];
-
- [self _accessibilityRegisterUIProcessTokens];
+
+ _data->_flagsChangedEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSFlagsChangedMask handler:^(NSEvent *flagsChangedEvent) {
+ [self _postFakeMouseMovedEventForFlagsChangedEvent:flagsChangedEvent];
+ return flagsChangedEvent;
+ }];
+
+ [self _accessibilityRegisterUIProcessTokens];
} else {
_data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
_data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive | WebPageProxy::ViewIsInWindow);
+ [NSEvent removeMonitor:_data->_flagsChangedEventMonitor];
+ _data->_flagsChangedEventMonitor = nil;
+
#if ENABLE(GESTURE_EVENTS)
if (_data->_endGestureMonitor) {
[NSEvent removeMonitor:_data->_endGestureMonitor];
@@ -2703,10 +2710,6 @@
#endif
_data->_mouseDownEvent = nil;
_data->_ignoringMouseDraggedEvents = NO;
- _data->_flagsChangedEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSFlagsChangedMask handler:^(NSEvent *flagsChangedEvent) {
- [self _postFakeMouseMovedEventForFlagsChangedEvent:flagsChangedEvent];
- return flagsChangedEvent;
- }];
[self _registerDraggedTypes];
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes