From 8eecf899ccb5c1d00c69c77ec8719dfdc2b49989 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 873053b..afe67d1 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; } -- 2.7.4