[webkit-changes] [23552] trunk/WebKit
Kevin Decker
kdecker at apple.com
Fri Jun 15 14:48:13 PDT 2007
Darin brings up a good point on IRC: under GC, dealloc isn't even
called. So this code still crashes under GC. On IRC we discussed
checking for the presence of a superview. I still recommend checking
for the superview, it seems safest.
-kd
On Jun 15, 2007, at 2:17 PM, andersca at webkit.org wrote:
> Revision
> 23552
> Author
> andersca
> Date
> 2007-06-15 14:17:47 -0700 (Fri, 15 Jun 2007)
> Log Message
>
> Reviewed by Kevin.
>
> <rdar://problem/5271774> REGRESSION: A crash occurs when
> closing a window that contains a QT movie
>
> In some cases, calling [super dealloc] might end up calling
> visibleRect, so make sure to
> set _element to 0 so we won't send a message to a freed
> object and crash.
>
> * Plugins/WebKitPluginContainerView.mm:
> (-[WebKitPluginContainerView dealloc]):
> (-[WebKitPluginContainerView visibleRect]):
> Modified Paths
>
> trunk/WebKit/ChangeLog
> trunk/WebKit/Plugins/WebKitPluginContainerView.mm
> Diff
>
> Modified: trunk/WebKit/ChangeLog (23551 => 23552)
> --- trunk/WebKit/ChangeLog 2007-06-15 19:21:10 UTC (rev 23551)
> +++ trunk/WebKit/ChangeLog 2007-06-15 21:17:47 UTC (rev 23552)
> @@ -1,3 +1,16 @@
> +2007-06-15 Anders Carlsson <andersca at apple.com>
> +
> + Reviewed by Kevin.
> +
> + <rdar://problem/5271774> REGRESSION: A crash occurs when
> closing a window that contains a QT movie
> +
> + In some cases, calling [super dealloc] might end up calling
> visibleRect, so make sure to
> + set _element to 0 so we won't send a message to a freed
> object and crash.
> +
> + * Plugins/WebKitPluginContainerView.mm:
> + (-[WebKitPluginContainerView dealloc]):
> + (-[WebKitPluginContainerView visibleRect]):
> +
> 2007-06-14 Anders Carlsson <andersca at apple.com>
>
> Reviewed by Geoff.
> Modified: trunk/WebKit/Plugins/WebKitPluginContainerView.mm (23551
> => 23552)
> --- trunk/WebKit/Plugins/WebKitPluginContainerView.mm 2007-06-15
> 19:21:10 UTC (rev 23551)
> +++ trunk/WebKit/Plugins/WebKitPluginContainerView.mm 2007-06-15
> 21:17:47 UTC (rev 23552)
> @@ -44,11 +44,19 @@
> - (void)dealloc
> {
> [_element release];
> +
> + // Calling [super dealloc] can end up calling visibleRect so we
> need to set
> + // the _element instance to 0 here so we can check for it in
> our visibleRect.
> + _element = 0;
> +
> [super dealloc];
> }
>
> - (NSRect)visibleRect
> {
> + if (!_element)
> + return [super visibleRect];
> +
> // WebCore may impose an additional clip (via CSS overflow or
> clip properties). Fetch
> // that clip now.
> return NSIntersectionRect([self convertRect:[_element
> _windowClipRect] fromView:nil], [super visibleRect]);
> _______________________________________________
> webkit-changes mailing list
> webkit-changes at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo/webkit-changes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/webkit-changes/attachments/20070615/35927d12/attachment.html
More information about the webkit-changes
mailing list