Fix: GPv3: Memory leaks from Grease Pencil undo steps
The `StepObject` stores customdata but relies on C++ object destruction. CustomData is a C struct and doesn't get freed automatically, the StepObject needs a destructor that takes care of the owned custom data. Pull Request: https://projects.blender.org/blender/blender/pulls/119125
This commit is contained in:
@@ -290,6 +290,11 @@ class StepObject {
|
||||
}
|
||||
|
||||
public:
|
||||
~StepObject()
|
||||
{
|
||||
CustomData_free(&layers_data_, layers_num_);
|
||||
}
|
||||
|
||||
void encode(Object *ob, StepEncodeStatus &encode_status)
|
||||
{
|
||||
const GreasePencil &grease_pencil = *static_cast<GreasePencil *>(ob->data);
|
||||
|
||||
Reference in New Issue
Block a user