Craig Hopson Posted December 19, 2012 Share Posted December 19, 2012 hi all new day new problem... ok i THINK the problem i'm having is memory leak but not shore. my script logs user location as they move, if you look at http://chsites.co.uk/track/www/index.html Tracking ID = 97Send at most every (sec) = 5Minimum Accuracy (meters) = 100000 then open your debug console (i have some notes in there still debugging) you will see that it logs every 5 seconds all good it works BUT after some time it will lock up the browser and eventually crash italso problem 2 it will post multi times like 3 times at once how can i stop that so to recap...problem 1:- browser locking up after some time.problem 2:-multi posting. Thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted December 19, 2012 Share Posted December 19, 2012 I get an error message when I submit that says user denied geolocation. Reloading the page shows the same thing, I can't get back to the form. Link to comment Share on other sites More sharing options...
Craig Hopson Posted December 19, 2012 Author Share Posted December 19, 2012 (edited) click settings to get back to form saying that it still logged your location Edited December 19, 2012 by Craig Hopson Link to comment Share on other sites More sharing options...
justsomeguy Posted December 19, 2012 Share Posted December 19, 2012 The reason you're using all of the memory is because you keep adding listeners via watchposition. You only need to call that function once to set the success and error listeners. Every time you call StartTracking you add another set of event listeners. That takes memory, you're making an enormous call stack to run when the position changes. If you call StartTracking 1000 times, then you're registering 1000 sets of event listeners and when the position changes it's going to call the success function 1000 times. If you want to check the current position then use getCurrentPosition. I suspect that's probably related to the post issue but I'm not going to test that because, no offense, but you don't need my latitude and longitude. I have that disabled for a reason. Link to comment Share on other sites More sharing options...
Craig Hopson Posted December 19, 2012 Author Share Posted December 19, 2012 oh i see thanks ill have a look Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now