]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryActivity.java
Ensure there is no ListAdapter using the closed file.
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryActivity.java
index e63916c03c64ef6f364e14d72bef68fca3ec0785..863e20b81bffcaaefa20935baef6ac467af99715 100644 (file)
@@ -230,6 +230,8 @@ public class DictionaryActivity extends ActionBarActivity {
     private void dictionaryOpenFail(Exception e) {
         Log.e(LOG, "Unable to load dictionary.", e);
         if (dictRaf != null) {
+            indexAdapter = null;
+            setListAdapter(null);
             try {
                 dictRaf.close();
             } catch (IOException e1) {
@@ -710,6 +712,9 @@ public class DictionaryActivity extends ActionBarActivity {
         textToSpeech.shutdown();
         textToSpeech = null;
 
+        indexAdapter = null;
+        setListAdapter(null);
+
         try {
             Log.d(LOG, "Closing RAF.");
             dictRaf.close();