KhronosGroup / SPIRV-LLVM

This project is no longer active. Please join us at
https://github.com/KhronosGroup/SPIRV-LLVM-Translator
Other
262 stars 60 forks source link

Fixes for memory leaks in SPIR-V library. #233

Closed PawelJurek closed 6 years ago

PawelJurek commented 6 years ago

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.

AlexeySotkin commented 6 years ago

Could you make commit message 80 symbols wide.