]> gitweb.fperrin.net Git - Dictionary.git/commitdiff
Ensure there is no ListAdapter using the closed file.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sun, 5 Nov 2017 19:54:02 +0000 (20:54 +0100)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sun, 5 Nov 2017 19:54:02 +0000 (20:54 +0100)
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();