Bug 771976 - Part 3: Make sure that nsEditorSpellCheck's refcount doesn't go down prematurely; r=roc

--HG--
extra : rebase_source : 08c052ed543bbdcb8bc2c084e8aff24fbd4b40a5
This commit is contained in:
Ehsan Akhgari 2012-07-17 23:02:00 -04:00
parent 8ab3329755
commit 7ce5477f9b

View File

@ -500,8 +500,6 @@ nsEditorSpellCheck::GetCurrentDictionary(nsAString& aDictionary)
{
NS_ENSURE_TRUE(mSpellChecker, NS_ERROR_NOT_INITIALIZED);
nsRefPtr<nsEditorSpellCheck> kungFuDeathGrip = this;
return mSpellChecker->GetCurrentDictionary(aDictionary);
}
@ -510,6 +508,8 @@ nsEditorSpellCheck::SetCurrentDictionary(const nsAString& aDictionary)
{
NS_ENSURE_TRUE(mSpellChecker, NS_ERROR_NOT_INITIALIZED);
nsRefPtr<nsEditorSpellCheck> kungFuDeathGrip = this;
if (!mUpdateDictionaryRunning) {
nsDefaultStringComparator comparator;
@ -598,6 +598,8 @@ nsEditorSpellCheck::UpdateCurrentDictionary()
{
nsresult rv;
nsRefPtr<nsEditorSpellCheck> kungFuDeathGrip = this;
UpdateDictionnaryHolder holder(this);
// Get language with html5 algorithm