Index: Source/core/editing/spellcheck/SpellCheckRequester.cpp |
diff --git a/Source/core/editing/spellcheck/SpellCheckRequester.cpp b/Source/core/editing/spellcheck/SpellCheckRequester.cpp |
index a5a99b8e2d641440ee7c76e0e59982527298ba69..acdea4597f8967f6609b5699ebd750859fa50932 100644 |
--- a/Source/core/editing/spellcheck/SpellCheckRequester.cpp |
+++ b/Source/core/editing/spellcheck/SpellCheckRequester.cpp |
@@ -211,6 +211,17 @@ void SpellCheckRequester::invokeRequest(PassRefPtrWillBeRawPtr<SpellCheckRequest |
client().requestCheckingOfString(m_processingRequest); |
} |
+void SpellCheckRequester::clearProcessingRequest() |
+{ |
+ // This assumes that m_processingRequest's Ranges aren't shared. |
+ if (m_processingRequest->checkingRange()) |
+ m_processingRequest->checkingRange()->dispose(); |
+ if (m_processingRequest->paragraphRange()) |
+ m_processingRequest->paragraphRange()->dispose(); |
+ |
+ m_processingRequest.clear(); |
+} |
+ |
void SpellCheckRequester::enqueueRequest(PassRefPtrWillBeRawPtr<SpellCheckRequest> request) |
{ |
ASSERT(request); |
@@ -251,7 +262,7 @@ void SpellCheckRequester::didCheck(int sequence, const Vector<TextCheckingResult |
if (m_lastProcessedSequence < sequence) |
m_lastProcessedSequence = sequence; |
- m_processingRequest.clear(); |
+ clearProcessingRequest(); |
if (!m_requestQueue.isEmpty()) |
m_timerToProcessQueuedRequest.startOneShot(0, FROM_HERE); |
} |