View Single Post
Old 12-10-2025, 01:14 PM   #47
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,154
Karma: 6565346
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by DiapDealer View Post
The memory-only caches definitely eliminated the delays for me. I wonder if we could track down which QtWebEngine disk cache is leaking through our memory-cache only strategy for subsequent Sigil instances and patch it on our Windows Qt?

https://github.com/kovidgoyal/bypy/b...qt_base.py#L65
The second and third instance of Sigil should, according to Qt docs return a nullptr when trying to use a named cache folder that is already employed by an earlier version of Sigil.

This must be failing.

The code is here:

Code:
    QWebEngineProfileBuilder pb;
    pb.setCachePath(PreviewCachePath);
    pb.setHttpCacheMaximumSize(0); // 0 - means let Qt control it
    pb.setHttpCacheType(QWebEngineProfile::DiskHttpCache);
    pb.setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies);
    pb.setPersistentPermissionsPolicy(QWebEngineProfile::PersistentPermissionsPolicy::StoreOnDisk);
    pb.setPersistentStoragePath(localStorePath);
    m_preview_profile = pb.createProfile("Preview", nullptr);
    // handle possible nullptr return by creating a off the record profile
    if (!m_preview_profile) {
        m_preview_profile = QWebEngineProfileBuilder::createOffTheRecordProfile(nullptr);
    }
And here is what the Builder class docs say ...

Quote:
QWebEngineProfile *QWebEngineProfileBuilder::createProfile(const QString &storageName, QObject *parent = nullptr) const

Constructs a profile with the storage name storageName and parent parent.

The storage name is used to give each disk-based profile, a separate subdirectory for persistent data and cache. The storage location must be unique during application life time. It is up to the user to prevent the creation of profiles with same storage's location, which can lead to corrupted browser cache.

A disk-based QWebEngineProfile should be destroyed before the application exit, otherwise the cache and persistent data may not be fully flushed to disk.

Note: When creating a disk-based profile, if the data path is already in use by another profile, the function will return a null pointer.
Notice the last line.
KevinH is offline   Reply With Quote