quicksilver/Quicksilver — pull request #1984 by skurfer (2014-11-08 18:57:10+00:00)
Title: small adjustment

A small adjustment to #1927. I was occasionally getting into a situation where the interface worked normally, but none of the actions would actually do anything when executed. The console showed

2014/11/05 2:31:56.057 PM Quicksilver[13456]: An uncaught exception was raised
2014/11/05 2:31:56.057 PM Quicksilver[13456]: *** -[__NSPlaceholderSet initWithObjects:count:]: attempt to insert nil object from objects[335]

The stack trace that followed pointed to the new section where we make copies of `iconLoadedSet` and `childLoadedSet`, which was wrapped in `@synchronized (self)`. So I read the docs and discovered that this doesn’t actually protect `self` from changes. It just prevents any other section wrapped in `@synchronized (self)` from running at the same time. But we didn’t have any other sections like that. When changing the sets, we were using `@synchronized ([self class])`, so that’s what we should use here or it won’t do anything.

It was an intermittent problem, so I don’t know for sure that I’ve fixed, but I think this is correct.

(If I’m reading it right, we could put *anything* in parentheses, as long as it’s the same in all the places we want to lock for a particular purpose.)