mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-08-11 13:48:37 +02:00
Merge aba2a98064
into 768ece6921
This commit is contained in:
commit
b0af84d7f8
@ -460,9 +460,8 @@ export function FileContextProvider({
|
|||||||
thumbnailGenerationService.destroy();
|
thumbnailGenerationService.destroy();
|
||||||
|
|
||||||
// Force garbage collection hint
|
// Force garbage collection hint
|
||||||
if (typeof window !== 'undefined' && window.gc) {
|
if (typeof window !== 'undefined') {
|
||||||
let gc = window.gc
|
setTimeout(() => window.gc && window.gc(), 100);
|
||||||
setTimeout(() => gc(), 100);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -597,10 +596,9 @@ export function FileContextProvider({
|
|||||||
dispatch({ type: 'SET_CURRENT_MODE', payload: mode });
|
dispatch({ type: 'SET_CURRENT_MODE', payload: mode });
|
||||||
|
|
||||||
if (state.currentMode !== mode && state.activeFiles.length > 0) {
|
if (state.currentMode !== mode && state.activeFiles.length > 0) {
|
||||||
if (window.requestIdleCallback && typeof window !== 'undefined' && window.gc) {
|
if (window.requestIdleCallback && typeof window !== 'undefined') {
|
||||||
let gc = window.gc;
|
|
||||||
window.requestIdleCallback(() => {
|
window.requestIdleCallback(() => {
|
||||||
gc();
|
window.gc && window.gc();
|
||||||
}, { timeout: 5000 });
|
}, { timeout: 5000 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -612,10 +610,9 @@ export function FileContextProvider({
|
|||||||
dispatch({ type: 'SET_CURRENT_VIEW', payload: view });
|
dispatch({ type: 'SET_CURRENT_VIEW', payload: view });
|
||||||
|
|
||||||
if (state.currentView !== view && state.activeFiles.length > 0) {
|
if (state.currentView !== view && state.activeFiles.length > 0) {
|
||||||
if (window.requestIdleCallback && typeof window !== 'undefined' && window.gc) {
|
if (window.requestIdleCallback && typeof window !== 'undefined') {
|
||||||
let gc = window.gc;
|
|
||||||
window.requestIdleCallback(() => {
|
window.requestIdleCallback(() => {
|
||||||
gc();
|
window.gc && window.gc();
|
||||||
}, { timeout: 5000 });
|
}, { timeout: 5000 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -519,9 +519,8 @@ export class EnhancedPDFProcessingService {
|
|||||||
this.notifyListeners();
|
this.notifyListeners();
|
||||||
|
|
||||||
// Force memory cleanup hint
|
// Force memory cleanup hint
|
||||||
if (typeof window !== 'undefined' && window.gc) {
|
if (typeof window !== 'undefined') {
|
||||||
let gc = window.gc;
|
setTimeout(() => window.gc && window.gc(), 100);
|
||||||
setTimeout(() => gc(), 100);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user