My current fix for the orphan window bug is to leave out the event loop code that is run in JuceVSTWrapper.mm on closing. change "if (needToRunMessageLoop)" to "if(0)" or something.
The comments say that leaving out this code causes crashes in Live when you delete the plugin with its window open. I'm guessing this was true for some version of OS / Live but in my testing I actually found the opposite. I tested three setups with Live: OS 10.10.2 / Live 9.1.7, and OS 10.6.8 / Live 9.0.6 and Live 8. All in 32-bit VST because that's where the bug was happening.
Before leaving out this code, on 10.10.2 / 9.1.7, Live was crashing often on editor deletion. The crash was always occurring in one of the runDispatchLoopUntil() calls. runDispatchLoopUntil() would get called successfully a various number of times, sometimes as few as 3. But when the crash occurred it always entered runDispatchLoopUntil() without returning.
So I tried leaving out this Cocoa cleanup stuff and since then I have seen no crashes. I am also not seeing any of the Cocoa views or Windows or any Components leaking.
I have also tried the new code in a bunch of other hosts including Reaper on both 10.10.2 and 10.6.8 and it seems to work across the board.
Hurriedly forgot to mention actual orphan window fix part, which is to remove [hostWindow retain] from attachComponentToWindowRef (Component* comp, void* parentWindowOrView, bool isNSView); in JuceVSTWrapper.mm.