oconnor663 / fbmessenger

[deprecated] a PyQt clone of Facebook Messenger for Windows
Other
102 stars 22 forks source link

Race condition in external.init(), browser <--> external dependency is weird #56

Open oconnor663 opened 10 years ago

oconnor663 commented 10 years ago

We make all our calls to bind_external() after the browser windows are already created. It's possible that JS in our windows could start running before the external object that it depends on is bound. Not sure if this ever happens.

This highlights a deeper issue, though, which is that external.py and browser.py are really poorly organized as separate modules. They depend on each other, and we end up with awful circularity issues like the one in main.py, where the application module has to be imported first or things break. Organizing things properly will probably fix this race condition too.