Stack overflow in SC.imageCache on IE
Reported by timo | August 12th, 2008 @ 07:00 AM | in REL 0.9.21
While testing my app on IE I received "Stack overflow: line 0" which didn't tell much. Some images where left out loading so this pointed to image loading issue.
I haven't tried to reproduce this issue e.g. on Photos demo but I found out that images left out loading issue rises partly because I was lazy and made more test data by multiplying my fixture six times. So same image url got loaded many times.
SC.imageCache.loadImage I think here is the first logical error. Code just checks if the image for the url is already loaded when instead it should check is the dta (url) already qeued and if not only then qeue it.
SC.imageCache.loadNextImage There's while loop and on IE some pretty odd happens here. I found out that "this.loading.push(dta.url);" was never reached and execution just jumped "changeStatus" method. Maybe this was because I was running on local file or images where in cache. Anyway moving the line above setting image src seems to resolve this.
SC.imageCache._changeStatus Here's actually source of stack overflow on last line where "loadNextImage" is called. Maybe this can end up calling recursively it self. Adding timeout to this call seems fix this issue.
Comments and changes to this ticket
-

Erich Ocean (onitunes) September 30th, 2008 @ 04:18 AM
- → Milestone changed from to REL 0.9.21
- → State changed from new to open
- → Assigned user changed from to Erich Ocean (onitunes)
-

Erich Ocean (onitunes) November 8th, 2008 @ 09:26 AM
- → Assigned user cleared.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
SproutCore: JavaScript Application Framework
Source available from github
The Git repository resides at http://github.com/sproutit
Check out the current development trunk with:
git clone git://github.com/sproutit/sproutcore.git
Creating a bug report
When creating a bug report, be sure to include as much relevant information as possible. Post the code sample that causes the problem. Preferably, alter the unit tests and show through either changed or added tests how the expected behavior is not occuring.
Submitting Patches
Resist adding new tags, use the ones in the tag cloud already. If you are submitting a patch or a pull request from a fork, tag the ticket as a "patch". If you are submitting a new feature enhancement, tag it as "enhancement". If you are submitting a fix for a bug, tag it as "fix".
Thanks!
We're glad you're contributing. Feel free to drop by the Google Group as well to let us know you are involved.
