I've written a fairly simply QuickLook plugin, which displays the files of a .torrent
file,
The complete code is here on Github, and the main file is torrent.m
The reason I'm looking for feedback is it's acting slightly weirdly.. After building/installing the plugin (into ~/Library/QuickLook/
), and running..
qlmanage -r; qlmanage -p ~/test.torrent
..it works perfectly, but actually invoking QuickLook (via the "space" or cmd+y
shortcut), the first time is fine, then there are problems - strange characters after the data (similar to the solved with this question), or it falls back to the default "show file info and icon" quicklook plugin.
I'm assuming it's a memory-leak related problem.. I could be wrong, but the qlmanage command's memory should be "clean" (being a new process), but the quicklook daemon is long running, meaning it would be messed up by the leak..
I ran the Clang static analyser on the code, and the only leaks it found were in the BEncoding.m
.. I found it hard to believe the library was at fault (not my messy code), espically given this answer saying the leak
tool is innacurate with garbage-collected code (not sure if this applies to Clang?), thus this question!