Hold a reference to ShaderDiskCache while its Init() is called
ShaderDiskCache's reference count used to be 0 at the beginning of Init(), and be incremented implicitly by base::Bind there. As the reference count is decremented to 0 if CreateCacheBackend finished immediately and the passed callback is destroyed. That causes unexpected destruction of the SharedDiskCache instance. After this CL, the caller of Init() keeps an reference while Init() is running to avoid destroying the ShaderDiskCache instance. Bug: 866456 Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel Change-Id: Iddf9daaf09119aed279ffb81f0af1a74efb9dc54 Reviewed-on: https://chromium-review.googlesource.com/1148090Reviewed-by:Jonathan Backer <backer@chromium.org> Commit-Queue: Taiju Tsuiki <tzik@chromium.org> Cr-Commit-Position: refs/heads/master@{#577613}
Showing
Please register or sign in to comment