Bug 1204147 - Prevent content preferences being written when they shouldn't. r=roc
authorJorg K <mozilla@jorgk.com>
Fri, 11 Sep 2015 23:03:00 +0200
changeset 294916 a3994f4ac9df331302de2a4a7fb421ae8bbe2024
parent 294915 9a3bfacb1a093a26e6dc3532182875ba4b1dbccb
child 294917 361c6d3c4678973ecf0fec2ae94769210d160c44
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1204147
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1204147 - Prevent content preferences being written when they shouldn't. r=roc
editor/composer/nsEditorSpellCheck.cpp
--- a/editor/composer/nsEditorSpellCheck.cpp
+++ b/editor/composer/nsEditorSpellCheck.cpp
@@ -648,16 +648,19 @@ nsEditorSpellCheck::CheckCurrentDictiona
   }
 
   // If our preferred current dictionary has gone, pick another one.
   nsTArray<nsString> dictList;
   rv = mSpellChecker->GetDictionaryList(&dictList);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (dictList.Length() > 0) {
+    // Use RAII object to prevent content preferences being written during
+    // this call.
+    UpdateDictionaryHolder holder(this);
     rv = SetCurrentDictionary(dictList[0]);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP