2011-05-10 MORITA Hajime <morrita@google.com>
authorMORITA Hajime <morrita@google.com>
Tue, 10 May 2011 07:46:51 +0000 (07:46 +0000)
committerAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Tue, 10 May 2011 20:20:22 +0000 (17:20 -0300)
commitf38046d3f22a2d67b5a745341f74f4fce3e978e3
treecee0f1bb01c399c5b68a3645af6e5bcec3f19d70
parent23173279ad88da651e06bd41ad84caaea715b1b8
2011-05-10  MORITA Hajime  <morrita@google.com>

        Reviewed by Ryosuke Niwa.

        REGRESSION(r73886): Frequent crashes in replaceSelectionWithFragment
        https://bugs.webkit.org/show_bug.cgi?id=60090

        SpellChecker uses TextCheckerClient, which belongs Page object,
        which is possibly destroyed during SpellChecker's lifetime.
        This change added to a guard before using TextCheckerClient to
        ensure it being live.

        No new tests, this is a speculative fix for a real crash.

        * editing/Editor.cpp:
        (WebCore::Editor::Editor):
        * editing/SpellChecker.cpp:
        (WebCore::SpellChecker::SpellChecker):
        (WebCore::SpellChecker::client):
        (WebCore::SpellChecker::canCheckAsynchronously):
        (WebCore::SpellChecker::requestCheckingFor):
        * editing/SpellChecker.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86132 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/SpellChecker.cpp
Source/WebCore/editing/SpellChecker.h