New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve late injection race conditional #1165
Comments
The patch for this has been completed. |
Really liking that patch! I'd just prefer a better name than |
Alright, I changed it to something less vague. |
I've discovered a few more issue. |
Okay, the branch now fixes all late injection failure issues. I ran into tons of gotchas, but now everything appears to be stable. |
Thanks a million for the work! I was pretty sure there were issues buried in here, but hadn't got to looking into it deeply yet. |
Quick review:
And (how) are we handling the case where the window doesn't exist anymore, once the dependencies have been downloaded? Does it still exist, because of the |
Thanks a million for the work!You're very welcome. I was pretty sure there were issues buried in here Yeah I thought so too. This issue has been lingering even since I started live meta and want this feature(re-downloading dependencies) to work intuitively for users. Hopefully I've finally managed to do that. Quick review: Okay, most of your suggestions are in this commit. Although I didn't set pendingExec to And (how) are we handling the case where the window doesn't exist anymoreThe reference to a closed window only exists temporarily until we finish downloading the scripts. Then it gets thrown away with the other windows. Does it still exist, because of the pendingExec reference The way I understand it all we have is a handle to the window, we can't actually keep the window around by keeping the handle to it. Are we leaking memory with these window references (i.e. does running the script create another reference)?In JavaScript the only way to leak memory is to hold on to a reference. By setting this.script.pendingExec to null on line 209 of scriptdownloader.js we ditch our only reference to the windows so the GC can reclaim the memory. All other references to the windows are local so they go out of scope and can be reclaimed. |
I've merged this branch with the latest upstream changes. |
Fixed by fast-forward merge (of about a dozen commits), so there's nothing obvious to link to. But done! |
Push window vars to the window list before scriptDownloader.fetchDependencies is called.
… can turn it off. This gets rid of the bug where you remove dependencies, and the delayInjection flag remains perpetually on. Closes greasemonkey#1165
…asemonkey#1165 Conflicts: content/script.js content/scriptdownloader.js
While dependencies are being downloaded store the windows that wish to inject the script. Once the downloads have completed, late inject the script in all those windows.
Ref: http://groups.google.com/group/greasemonkey-dev/browse_thread/thread/6025568018a7108d/497343594244f2bd
The text was updated successfully, but these errors were encountered: