From 6d5d0a154b02bb332753d5d17f5b2ab89a2b17a5 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Thu, 17 Jun 2021 12:04:12 +0900 Subject: [PATCH] common Scene: return FailedAllocation if it really failed at memory allocation. 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/tvgScene.cpp b/src/lib/tvgScene.cpp index 873053bf..afe67d19 100644 --- a/src/lib/tvgScene.cpp +++ b/src/lib/tvgScene.cpp @@ -56,7 +56,7 @@ Result Scene::push(unique_ptr paint) noexcept Result Scene::reserve(uint32_t size) noexcept { - pImpl->paints.reserve(size); + if (!pImpl->paints.reserve(size)) return Result::FailedAllocation; return Result::Success; }