Bug 38759

Summary: [Qt] Initializing the icon database twice in a row raise an assert
Product: WebKit Reporter: Jocelyn Turcotte <jturcotte>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WORKSFORME    
Severity: Critical CC: benjamin, hausmann
Priority: P2 Keywords: Qt, QtTriaged
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Test app none

Jocelyn Turcotte
Reported 2010-05-07 09:38:01 PDT
Created attachment 55387 [details] Test app See the attached test for a common possible case: QWebSettings::enablePersistentStorage(); QWebSettings::globalSettings()->setIconDatabasePath("."); When we call QWebSettings::setIconDatabasePath() we don't make sure that the icon database has been closed before opening it again. There is protection for that in IconDatabase::open() by checking if the sqlite database is open, however it don't work here since the state only change when the database is opened on the spawned thread. I don't know what happens in release, there might be an opened sqlite database on the first path specified to setIconDatabasePath. Reproduced on MSVC2008.
Attachments
Test app (518 bytes, application/octet-stream)
2010-05-07 09:38 PDT, Jocelyn Turcotte
no flags
Benjamin Poulain
Comment 1 2010-11-10 06:54:55 PST
Works for me. Your example crashes because there is no QApplication instance so threads are not working properly. By changing it to: #include <QApplication> #include <QWebSettings> int main(int argc, char** argv) { QApplication app(argc, argv); QWebSettings::enablePersistentStorage(); QWebSettings::globalSettings()->setIconDatabasePath("."); return 0; } Everything works for me.
Note You need to log in before you can comment on or make changes to this bug.