EGL: fix eglTerminate blob cache behavior
Bug: 9610573 Change-Id: I258e7e0d82ab76fbacf0b9c25d4f92fca6df04ac
This commit is contained in:
parent
bdce817047
commit
5539e219de
@ -126,11 +126,8 @@ void egl_cache_t::initialize(egl_display_t *display) {
|
||||
|
||||
void egl_cache_t::terminate() {
|
||||
Mutex::Autolock lock(mMutex);
|
||||
if (mBlobCache != NULL) {
|
||||
saveBlobCacheLocked();
|
||||
mBlobCache = NULL;
|
||||
}
|
||||
mInitialized = false;
|
||||
saveBlobCacheLocked();
|
||||
mBlobCache = NULL;
|
||||
}
|
||||
|
||||
void egl_cache_t::setBlob(const void* key, EGLsizeiANDROID keySize,
|
||||
@ -218,7 +215,7 @@ static uint32_t crc32c(const uint8_t* buf, size_t len) {
|
||||
}
|
||||
|
||||
void egl_cache_t::saveBlobCacheLocked() {
|
||||
if (mFilename.length() > 0) {
|
||||
if (mFilename.length() > 0 && mBlobCache != NULL) {
|
||||
size_t cacheSize = mBlobCache->getFlattenedSize();
|
||||
size_t headerSize = cacheFileHeaderSize;
|
||||
const char* fname = mFilename.string();
|
||||
|
Loading…
Reference in New Issue
Block a user