~UniqueIDBDatabaseConnection should happen before ~UniqueIDBDatabase, but we protect UniqueIDBDatabaseConnection in UniqueIDBDatabase::connectionClosedFromClient.
<rdar://problem/60919105>
Created attachment 394654 [details] Patch
Comment on attachment 394654 [details] Patch It's not great for correctness to rely on destruction order. We don't have a smart reliable way to guarantee destruction order. I think a better solution in this case would be to change UniqueIDBDatabaseConnection to hold a direct pointer to IDBServer. That way, there's no need to deference UniqueIDBDatabase in the destructor. Also, it would be good to change UniqueIDBDatabaseConnection::m_database to be a WeakPtr, for memory safety. (That way, a bug like this will be detectable even without guard malloc, and will not become a security bug.)
Created attachment 394662 [details] Patch
Comment on attachment 394662 [details] Patch r=me
Committed r259090: <https://trac.webkit.org/changeset/259090> All reviewed patches have been landed. Closing bug and clearing flags on attachment 394662 [details].