OSDN Git Service

vulkan: avoid double-free in InitSharedPtr
authorChia-I Wu <olv@google.com>
Thu, 7 Apr 2016 07:01:55 +0000 (15:01 +0800)
committerChia-I Wu <olv@google.com>
Sun, 10 Apr 2016 22:35:49 +0000 (06:35 +0800)
commitc684560d96df39570c66b2b3e0035859bb4b25a5
treeece8823eff0d8cd67781676d2c3d5ec0398f7272
parent79632ee48a8cddf31a1ec15c0c5217b3d3608622
vulkan: avoid double-free in InitSharedPtr

When std::shared_ptr fails to allocate its internal data, it deletes the
managed object automatically.  We should not call obj->common.decRef on
std::bad_alloc.

Bug: 28039233
Change-Id: I1fe00c16e83e426602eac96d8b86afb4fd4830e6
vulkan/libvulkan/swapchain.cpp