I wrote a fairly simple QuickLook plugin that displays .torrent file files,
The full code is here on Github , and the main file is torrent.m
The reason I'm looking for a review is a bit strange .. After creating / installing the plugin (in ~/Library/QuickLook/ ) and running it.
qlmanage -r; qlmanage -p ~/test.torrent
.. it works fine, but actually calls QuickLook (through a space or cmd+y shortcut), the first time is fine, then there are problems - strange characters after the data (similar to those resolved with this question ), or it goes back to The default is βshow file info and iconβ quicklook plugin.
I assume this is a memory leak problem. I could be wrong, but the qlmanage command's memory should be "clean" (being a new process), but the quicklook daemon runs for a long time, which means that it will be spoiled by a leak.
I ran the Clang static analyzer in the code, and the only leaks that it found were in BEncoding.m .. I found it hard to believe that the library was to blame (not my dirty code), espically gave this answer , saying that <Tool t26 > is impractical with code collected with garbage (not sure if this applies to Clang?), so this question!
source share