Closed pavlinux closed 2 years ago
No… you have to lock the mutexes so that you can guarantee no-one else is depending on them and the protected data being there, before freeing them…?
In general, the entire destroy() function is useless, except for two free()
destroy()
and its attempt to clean up would be “useless” if the following conditions were true:
nocache
interceptsFor most even slightly more complicated programs, these conditions don’t generally hold.
You can see the reasoning in the original commit that introduced it: https://github.com/Feh/nocache/commit/d355dafdae2d382bf4af60252e53174718d73698
If you are worried about the constant overhead the destroy()
function introduces, feel free to add some getenv()
type call in there to optionally skip cleanup steps.
https://github.com/Feh/nocache/blob/2b6ea1f6b46dabd08db6c6b8be78874b90ecfd22/nocache.c#L207
May be unlock ? ))