Note that there are some explanatory texts on larger screens.

plurals
  1. POFeedback on my first Objective-C code (a QuickLook plugin)
    primarykey
    data
    text
    <p>I've written a fairly simply QuickLook plugin, which displays the files of a <code>.torrent</code> file,</p> <p>The complete code is <a href="http://github.com/dbr/qltorrent/tree/45c4f1cb8a2d1e101a7543ebedc78fc1c8b87c01" rel="nofollow noreferrer">here on Github</a>, and the main file is <a href="http://github.com/dbr/qltorrent/blob/45c4f1cb8a2d1e101a7543ebedc78fc1c8b87c01/torrent.m" rel="nofollow noreferrer"><code>torrent.m</code></a></p> <p>The reason I'm looking for feedback is it's acting slightly weirdly.. After building/installing the plugin (into <code>~/Library/QuickLook/</code>), and running..</p> <pre><code>qlmanage -r; qlmanage -p ~/test.torrent </code></pre> <p>..it works perfectly, but actually invoking QuickLook (via the "space" or <code>cmd+y</code> shortcut), the first time is fine, then there are problems - strange characters after the data (similar to the solved <a href="https://stackoverflow.com/questions/550405/convert-nsdata-bytes-to-nsstring">with this question</a>), or it falls back to the default "show file info and icon" quicklook plugin.</p> <p>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..</p> <p>I ran the <a href="https://stackoverflow.com/questions/172125/avoiding-finding-and-removing-memory-leaks-in-cocoa/172243#172243">Clang static analyser</a> on the code, and the only leaks it found were in the <a href="http://github.com/dbr/qltorrent/blob/master/BEncoding.m" rel="nofollow noreferrer"><code>BEncoding.m</code></a>.. I found it hard to believe the library was at fault (not my messy code), espically given <a href="https://stackoverflow.com/questions/364172/memory-leaks-in-newly-created-cocoa-app-when-using-garbage-collection/364994#364994">this answer</a> saying the <code>leak</code> tool is innacurate with garbage-collected code (not sure if this applies to Clang?), thus this question!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload