common Scene: return FailedAllocation if it really failed at memory allocation.
authorJunsuChoi <jsuya.choi@samsung.com>
Thu, 17 Jun 2021 03:04:12 +0000 (12:04 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Mon, 21 Jun 2021 02:39:34 +0000 (11:39 +0900)
Due to change of f0ecc67, the return type of reserve() is changed to bool,
which can return the result for the fail case.

src/lib/tvgScene.cpp

index 873053b..afe67d1 100644 (file)
@@ -56,7 +56,7 @@ Result Scene::push(unique_ptr<Paint> paint) noexcept
 
 Result Scene::reserve(uint32_t size) noexcept
 {
-    pImpl->paints.reserve(size);
+    if (!pImpl->paints.reserve(size)) return Result::FailedAllocation;
 
     return Result::Success;
 }