OSDN Git Service

Fix stencil buffer memory leak.
authorNicolas Capens <nicolas.capens@gmail.com>
Sat, 29 Sep 2018 15:58:42 +0000 (11:58 -0400)
committerNicolas Capens <nicolascapens@google.com>
Mon, 1 Oct 2018 14:08:30 +0000 (14:08 +0000)
commit810f3db8264a911566fb7fd84970bc93e47b8726
treed3c815dc7a986b62cc253ed235f5634467223724
parent876760bb27d065fcce979f5a72a0afdb5a7bd1a8
Fix stencil buffer memory leak.

Locking stencil buffers with a NULL format resulted in nullptr being
returned without acquiring the resource lock, while unlocking did
release the lock.

Instead of not releasing it on unlock, we must acquire it on lock
because otherwise the object could get destroyed before draw operations
end and attempt to unlock.

Bug b/116876483

Change-Id: Ie883115a1d6df3b40eb7c1feb5dcfde7316ec970
Reviewed-on: https://swiftshader-review.googlesource.com/21148
Reviewed-by: Krzysztof Kosiński <krzysio@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Krzysztof Kosiński <krzysio@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
.travis.yml
src/Common/Resource.cpp
src/Renderer/Surface.cpp