Page MenuHome

Fix (unreported): Cryptomatte legacy node memory leak
AbandonedPublic

Authored by Manuel Castilla (manzanilla) on May 19 2021, 6:21 PM.

Details

Summary

When loading a blend file with a cryptomatte legacy node there is always a small memory leak on deleting the node. This was triggering an assert when running compositor render tests.

Leak can be reproduced by opening lib\tests\compositor\matte\node_cryptomatte_legacy.blend and closing blender.

Matte id node data was not being freed/copied.

Diff Detail

Repository
rB Blender
Branch
fix-crypto-node (branched from master)
Build Status
Buildable 14653
Build 14653: arc lint + arc unit

Event Timeline

Manuel Castilla (manzanilla) requested review of this revision.May 19 2021, 6:21 PM
Manuel Castilla (manzanilla) created this revision.
Manuel Castilla (manzanilla) planned changes to this revision.May 20 2021, 11:29 PM

This is not a proper solution. File in bug report T86271 crashes when closing blender.
That file loads 2 legacy cryptomatte nodes with same address for their matte_id string. Once one is freed when freeing the other will crash.
The memory leak happens too with that file in current master. Don't know how loading/saving file code works but node_copy_cryptomatte certainly duplicates matte_id pointer value, so this may happen with files being saved with duplicated legacy matte nodes in old files.