2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2021-10-03 14:23:26 +02:00
|
|
|
|
|
|
|
|
#include "BLI_resource_scope.hh"
|
|
|
|
|
|
|
|
|
|
namespace blender {
|
|
|
|
|
|
|
|
|
|
ResourceScope::ResourceScope() = default;
|
|
|
|
|
|
|
|
|
|
ResourceScope::~ResourceScope()
|
|
|
|
|
{
|
|
|
|
|
/* Free in reversed order. */
|
|
|
|
|
for (int64_t i = resources_.size(); i--;) {
|
|
|
|
|
ResourceData &data = resources_[i];
|
|
|
|
|
data.free(data.data);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace blender
|