faridco / rsox

libsox binding for Ruby
18 stars 20 forks source link

using a variable to store the effect object #11

Open esshka opened 1 year ago

esshka commented 1 year ago

The code does not free the memory allocated by sox_create_effect. For example, the function rb_sox_add_effect calls sox_create_effect to create an effect object, but it does not store it in a variable or pass it to a function that frees it. This can cause memory leaks. I recommend using a variable to store the effect object, and calling free on it after adding it to the chain.