#2338 fixed actionBar and webViewList leaks.

This commit is contained in:
HissPirat 2020-08-26 14:34:29 +02:00
parent bbb630b9ca
commit 22a29b8ed8

View File

@ -112,13 +112,13 @@ import org.kiwix.kiwixmobile.core.reader.ZimFileReader;
import org.kiwix.kiwixmobile.core.reader.ZimReaderContainer;
import org.kiwix.kiwixmobile.core.search.SearchActivity;
import org.kiwix.kiwixmobile.core.search.viewmodel.effects.SearchInPreviousScreen;
import org.kiwix.kiwixmobile.core.utils.dialog.DialogShower;
import org.kiwix.kiwixmobile.core.utils.ExternalLinkOpener;
import org.kiwix.kiwixmobile.core.utils.dialog.KiwixDialog;
import org.kiwix.kiwixmobile.core.utils.LanguageUtils;
import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil;
import org.kiwix.kiwixmobile.core.utils.StyleUtils;
import org.kiwix.kiwixmobile.core.utils.UpdateUtils;
import org.kiwix.kiwixmobile.core.utils.dialog.DialogShower;
import org.kiwix.kiwixmobile.core.utils.dialog.KiwixDialog;
import org.kiwix.kiwixmobile.core.utils.files.FileUtils;
import static android.app.Activity.RESULT_CANCELED;
@ -728,6 +728,8 @@ public abstract class CoreReaderFragment extends BaseFragment
tabCallback = null;
hideBackToTopTimer.cancel();
hideBackToTopTimer = null;
webViewList.clear();
actionBar = null;
tableDrawerAdapter.setTableClickListener(null);
tableDrawerAdapter = null;
unbinder.unbind();
@ -1655,7 +1657,8 @@ public abstract class CoreReaderFragment extends BaseFragment
}
}
selectTab(currentTab);
webViewList.get(currentTab).loadUrl(UpdateUtils.reformatProviderUrl(urls.getString(currentTab)));
webViewList.get(currentTab)
.loadUrl(UpdateUtils.reformatProviderUrl(urls.getString(currentTab)));
getCurrentWebView().setScrollY(positions.getInt(currentTab));
} catch (JSONException e) {
Log.w(TAG_KIWIX, "Kiwix shared preferences corrupted", e);