Cleanup: Correct usage of std::unique_ptr in Line Art code
`.release()` is technically fine but semantically wrong here. First, release is meant to take ownership from the unique_ptr, meaning at best it's "weird" to not do anything with the pointer afterwards. Second, the runtime struct with the unique_ptr was just default constructed, which means the unique_ptr will be empty anyway.
This commit is contained in:
@@ -100,11 +100,8 @@ static void copy_data(const ModifierData *md, ModifierData *target, const int fl
|
||||
|
||||
blender::Set<const Object *> *object_dependencies = source_runtime->object_dependencies.get();
|
||||
if (object_dependencies) {
|
||||
target_runtime->object_dependencies.reset(
|
||||
new blender::Set<const Object *>(*object_dependencies));
|
||||
}
|
||||
else {
|
||||
target_runtime->object_dependencies.release();
|
||||
target_runtime->object_dependencies = std::make_unique<blender::Set<const Object *>>(
|
||||
object_dependencies);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user