Skip to content

Commit 6fc0d11

Browse files
committed
disable lazy loading
1 parent ba9585c commit 6fc0d11

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/SumatraPDF.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,13 +1915,19 @@ void LoadDocumentAsync(LoadArgs* argsIn, bool activateExisting) {
19151915
});
19161916
}
19171917

1918+
static bool gDisableLazyLoad = true;
1919+
19181920
// remember which files failed to open so that a failure to
19191921
// open a file doesn't block next/prev file in
19201922
static StrVec gFilesFailedToOpen;
19211923

19221924
MainWindow* LoadDocument(LoadArgs* args, bool lazyLoad, bool activateExisting) {
19231925
CrashAlwaysIf(gCrashOnOpen);
19241926

1927+
if (gDisableLazyLoad) {
1928+
lazyLoad = false;
1929+
}
1930+
19251931
const char* path = args->FilePath();
19261932
if (activateExisting) {
19271933
MainWindow* existing = FindMainWindowByFile(path, true);

src/SumatraStartup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ void SetTabState(WindowTab* tab, TabState* state) {
369369

370370
// TODO: when files are lazy loaded, they do not restore TabState. Need to remember
371371
// it in LoadArgs and call SetTabState() if present after loading
372-
static void RestoreTabOnStartup(MainWindow* win, TabState* state, bool lazyLoad = true) {
372+
static void RestoreTabOnStartup(MainWindow* win, TabState* state, bool lazyLoad) {
373373
logf("RestoreTabOnStartup: state->filePath: '%s'\n", state->filePath);
374374
LoadArgs args(state->filePath, win);
375375
args.noSavePrefs = true;

0 commit comments

Comments
 (0)