| Index: webkit/dom_storage/dom_storage_context.cc
|
| diff --git a/webkit/dom_storage/dom_storage_context.cc b/webkit/dom_storage/dom_storage_context.cc
|
| index 6a67e8a5ea02a01d2525c66f05b908e61e8b3f85..3d32243c221f609a929f2098c783d8be941c7856 100644
|
| --- a/webkit/dom_storage/dom_storage_context.cc
|
| +++ b/webkit/dom_storage/dom_storage_context.cc
|
| @@ -46,14 +46,15 @@ DomStorageContext::~DomStorageContext() {
|
| if (session_storage_database_.get()) {
|
| // SessionStorageDatabase shouldn't be deleted right away: deleting it will
|
| // potentially involve waiting in leveldb::DBImpl::~DBImpl, and waiting
|
| - // shouldn't happen on this thread. This will unassign the ref counted
|
| - // pointer without decreasing the ref count, and is balanced by the Release
|
| - // that happens later.
|
| + // shouldn't happen on this thread.
|
| + SessionStorageDatabase* to_release = session_storage_database_.get();
|
| + to_release->AddRef();
|
| + session_storage_database_ = NULL;
|
| task_runner_->PostShutdownBlockingTask(
|
| FROM_HERE,
|
| DomStorageTaskRunner::COMMIT_SEQUENCE,
|
| base::Bind(&SessionStorageDatabase::Release,
|
| - base::Unretained(session_storage_database_.release())));
|
| + base::Unretained(to_release)));
|
| }
|
| }
|
|
|
|
|