In few places in the SPIR-V library a pattern of “dropAllReferences + removeFromParent” calls was used on values like functions and instructions, that were not meant to be reused. These lead to memory leaks, as these functions do not destruct the objects. The fix is to use “eraseFromParent” instead.
SPIRVDecorate objects were also not deallocated, as they were not added to owning module’s SPIRVEntry list. The fix is to add them, as all other similar entries, e.g. SPIRVDecorationGroup.
In few places in the SPIR-V library a pattern of “dropAllReferences + removeFromParent” calls was used on values like functions and instructions, that were not meant to be reused. These lead to memory leaks, as these functions do not destruct the objects. The fix is to use “eraseFromParent” instead. SPIRVDecorate objects were also not deallocated, as they were not added to owning module’s SPIRVEntry list. The fix is to add them, as all other similar entries, e.g. SPIRVDecorationGroup.