mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 716289 - crash in nsCacheService::SearchCacheDevices
This commit is contained in:
parent
882c79dd2c
commit
082226850a
16
netwerk/cache/nsCacheService.cpp
vendored
16
netwerk/cache/nsCacheService.cpp
vendored
@ -1461,16 +1461,16 @@ nsCacheService::CreateDiskDevice()
|
||||
mEnableDiskDevice = false;
|
||||
delete mDiskDevice;
|
||||
mDiskDevice = nsnull;
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_ASSERTION(!mSmartSizeTimer, "Smartsize timer was already fired!");
|
||||
|
||||
// Disk device is usually created during the startup. Delay smart size
|
||||
// calculation to avoid possible massive IO caused by eviction of entries
|
||||
// in case the new smart size is smaller than current cache usage.
|
||||
if (!mSmartSizeTimer) {
|
||||
mSmartSizeTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
mSmartSizeTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = mSmartSizeTimer->InitWithCallback(new nsSetDiskSmartSizeCallback(),
|
||||
1000*60*3,
|
||||
nsITimer::TYPE_ONE_SHOT);
|
||||
@ -1478,9 +1478,13 @@ nsCacheService::CreateDiskDevice()
|
||||
NS_WARNING("Failed to post smart size timer");
|
||||
mSmartSizeTimer = nsnull;
|
||||
}
|
||||
} else {
|
||||
NS_WARNING("Can't create smart size timer");
|
||||
}
|
||||
// Ignore state of the timer and return success since the purpose of the
|
||||
// method (create the disk-device) has been fulfilled
|
||||
|
||||
return rv;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
Loading…
Reference in New Issue
Block a user