Bastien Montagne da05bff96c Fix (unreported) Assets: MEM_new/MEM_freeN mismatch usages.
This one was a bit more involved than the previous ones, since the
mismatch was intentional here, and happened on a non-trivial type.

It was done because the new object (managed by the `unique_ptr`) steals
the internal data of the original object. Calling `MEM_delete` (and
therefore the destructor of the `AssetMetaData` object) would then lead
to access-after-free and double-freeing errors.

This is addressed by adding two new 'copy' and 'move' constructors to this type.

The copy one ensures that deep-copy of internal data happens as expected, and
allows to simplify greatly the code in `BKE_asset_metadata_copy`, which
becomes a mere wrapper around it.

The move one allows `make_unique` to properly steal (and clear) the internal
data of the source object, which can then safely be deleted.

Pull Request: https://projects.blender.org/blender/blender/pulls/123693
2024-06-27 09:44:22 +02:00
2024-06-14 15:48:27 +02:00
2024-06-26 15:55:57 +10:00
2024-06-26 21:30:39 +02:00
2023-12-08 13:28:13 +11:00
2024-06-18 12:09:43 +10:00

Blender

Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.

Blender screenshot

Project Pages

Development

License

Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.

See blender.org/about/license for details.

Description
No description provided
Readme 841 MiB
Languages
C++ 78%
Python 14.9%
C 2.9%
GLSL 1.9%
CMake 1.2%
Other 0.9%