Bug 771976 - Make sure that mozSpellChecker's refcount doesn't go down prematurely; r=roc

This commit is contained in:
Ehsan Akhgari 2012-07-11 14:38:24 -04:00
parent fcc673a579
commit 2717440a15

View File

@ -333,6 +333,9 @@ mozSpellChecker::GetCurrentDictionary(nsAString &aDictionary)
NS_IMETHODIMP NS_IMETHODIMP
mozSpellChecker::SetCurrentDictionary(const nsAString &aDictionary) mozSpellChecker::SetCurrentDictionary(const nsAString &aDictionary)
{ {
// Calls to mozISpellCheckingEngine::SetDictionary might destroy us
nsRefPtr<mozSpellChecker> kungFuDeathGrip = this;
mSpellCheckingEngine = nsnull; mSpellCheckingEngine = nsnull;
if (aDictionary.IsEmpty()) { if (aDictionary.IsEmpty()) {