Normally, when we detach the documentLoader in DocumentLoader::detachFromFrame, main resource is also cleared in stopLoading(). There is possibility that main resource not being cleared, and this could cause crash later since docLoader could still receive resource callbacks.
<rdar://problem/13924120>
Created attachment 202723 [details] clear main resource in detachFromFrame.
What if the document gets attached to a frame again (when restoring from page cache)? I suspect that it still needs its main resource then.
(In reply to comment #3) > What if the document gets attached to a frame again (when restoring from page cache)? I suspect that it still needs its main resource then. Good question! that would be a problem. I think instead of clear the main resource, we should just remove DocumentLoader from its client set, that way m_mainResource would still be alive and we won't receive callbacks when it is detached. Will post another patch.
Created attachment 202734 [details] don't clear the main resource, just remove docLoader from its client set to avoid getting callback after it is detached.
Attachment 202734 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/loader/DocumentLoader.cpp', u'Source/WebCore/loader/cache/CachedResource.h']" exit_code: 1 Source/WebCore/loader/DocumentLoader.cpp:1416: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 202736 [details] fix style issue.
Makes sense to me, but I think that Brady would be the best reviewer here.
Comment on attachment 202736 [details] fix style issue. thanks Brady.
Comment on attachment 202736 [details] fix style issue. Clearing flags on attachment: 202736 Committed r150613: <http://trac.webkit.org/changeset/150613>
All reviewed patches have been landed. Closing bug.