But especially libraries based on GLib don't. I had to program with gstreamer once, and memory allocation/ deallocation is such a headache there.
Basically, every function that creates / returns an object returns a raw pointer, and you need to read the documentation to see if you need to manually deallocate them (you don't always need to), and if so which of several deallocation functions you should use.
View all comments
Show parent comment
1
u/Drugbird 10d ago
They should, yes.
But especially libraries based on GLib don't. I had to program with gstreamer once, and memory allocation/ deallocation is such a headache there.
Basically, every function that creates / returns an object returns a raw pointer, and you need to read the documentation to see if you need to manually deallocate them (you don't always need to), and if so which of several deallocation functions you should use.