From 91f07d3317527703031378a388bc92853479d6a8 Mon Sep 17 00:00:00 2001 From: Patrick Scott Date: Thu, 9 Jul 2009 14:55:03 -0400 Subject: Do not merge Pull down http://trac.webkit.org/changeset/42163 to fix the icon database crash. I believe the issue was that m_syncThreadRunning could have been initialized to false if the moons aligned. When the Browser quits, it closes the icon db. If m_syncThreadRunning happened to be false, the close method would not wait for the sync thread to complete before cleaning up (and closing) the sqlite database. I think that caused the underlying db to be null within sqlite. --- WebCore/loader/icon/IconDatabase.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WebCore/loader/icon/IconDatabase.cpp b/WebCore/loader/icon/IconDatabase.cpp index 5705f7a..a5ea523 100644 --- a/WebCore/loader/icon/IconDatabase.cpp +++ b/WebCore/loader/icon/IconDatabase.cpp @@ -150,6 +150,7 @@ bool IconDatabase::open(const String& databasePath) // completes and m_syncThreadRunning is properly set m_syncLock.lock(); m_syncThread = createThread(IconDatabase::iconDatabaseSyncThreadStart, this, "WebCore::IconDatabase"); + m_syncThreadRunning = m_syncThread; m_syncLock.unlock(); if (!m_syncThread) return false; @@ -2026,6 +2027,7 @@ void IconDatabase::writeIconSnapshotToSQLDatabase(const IconSnapshot& snapshot) } else { readySQLiteStatement(m_setIconInfoStatement, m_syncDB, "INSERT INTO IconInfo (url,stamp) VALUES (?, ?);"); m_setIconInfoStatement->bindText(1, snapshot.iconURL); + m_setIconInfoStatement->m_statement = 0; m_setIconInfoStatement->bindInt64(2, snapshot.timestamp); if (m_setIconInfoStatement->step() != SQLResultDone) -- cgit v1.1