Commit 1c1bd94f authored by cblu's avatar cblu
Browse files

Fixed: 3129503 - Crash cancelling download after closing browser window that started download

        Reviewed by rjw.

        * WebView.subproj/WebDataSourcePrivate.m:
        (-[WebDataSource _setLoading:]): Added comment about our tragic dependence on a non-retained reference to the controller.
        (-[WebDataSource _recursiveStopLoading]): Call webFrame before calling _stopLoading because we release the controller in _stopLoading and we depend on it in webFrame.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3094 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 653ea5bd
=== Alexander-37 ===
2002-12-16 Chris Blumenberg <cblu@apple.com>
Fixed: 3129503 - Crash cancelling download after closing browser window that started download
Reviewed by rjw.
=== WebKit-37u3 ===
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSource _setLoading:]): Added comment about our tragic dependence on a non-retained reference to the controller.
(-[WebDataSource _recursiveStopLoading]): Call webFrame before calling _stopLoading because we release the controller in _stopLoading and we depend on it in webFrame.
=== Alexander-37 ===
2002-12-16 Maciej Stachowiak <mjs@apple.com>
......
......@@ -90,9 +90,11 @@ - (Class)_representationClass
- (void)_setLoading:(BOOL)loading
{
ASSERT_ARG(loading, loading == NO || loading == YES);
if (_private->loading == loading)
if (_private->loading == loading) {
return;
}
_private->loading = loading;
if (loading) {
......@@ -100,6 +102,9 @@ - (void)_setLoading:(BOOL)loading
[_private->controller retain];
} else {
[_private->controller release];
// FIXME: It would be cleanest to set the controller to nil here. Keeping a non-retained reference
// to the controller is dangerous. WebSubresourceClient actually depends on this non-retained reference
// when starting loads after the data source has stoppped loading.
[self release];
}
}
......@@ -237,8 +242,12 @@ - (void)_stopLoading
- (void)_recursiveStopLoading
{
[self retain];
[self _stopLoading];
// We depend on the controller in webFrame and we release it in _stopLoading,
// so call webFrame first so we don't send a message the released controller (3129503).
[[[self webFrame] children] makeObjectsPerformSelector:@selector(stopLoading)];
[self _stopLoading];
[self release];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment