minimedj / gaforflash

Automatically exported from code.google.com/p/gaforflash
Apache License 2.0
0 stars 0 forks source link

GIFRequest never cleans up _requests #49

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a GATracker
2. issue many tracking events (using trackEvent)

What is the expected output? What do you see instead?

When using the FlexBuilder profiler, we observe many URLRequests (and 
RequestObjects) persisting indefinitely. This is due 
to them being references by GIFRequest's _requests array.

What version of the product are you using? On what operating system?

gaforflash version: 1.0.1.319, OSX 10.5.5

Please provide any additional information below.

Seems like GIFRequest onIOError and onComplete just need to splice() the 
RequestObject out of _requests once they're done, 
and everything would work ... based on my inspection of the use of _requests, 
this should be safe, but I only looked at this 
code for the first time today.

Original issue reported on code.google.com by zakalawe@mac.com on 26 Mar 2009 at 4:54

GoogleCodeExporter commented 9 years ago
Screenshot from FlexBuilder profiler to hopefully clarify:

Original comment by zakalawe@mac.com on 26 Mar 2009 at 5:00

Attachments:

GoogleCodeExporter commented 9 years ago
Yes, it looks like an issue and your right, the loader objects, after being 
used, are
never deallocated from the _requests array. 

I'm not sure splice will work. The current solution sets the loader object's 
name to
an index into the array. If elements are spliced out, then the indexes will be 
off. I
think _requests will need to be made into an associative array, which the key 
will be
the name of the loader. Then one can access the loader's name from the IOError 
and
onComplete event objects to delete the proper object.

Original comment by Nicksk...@gmail.com on 31 Mar 2009 at 6:16

GoogleCodeExporter commented 9 years ago
yes this is valid, we started to store the request in an array and didn't 
implemented 
a clean up function yet

Original comment by zwetan on 31 Mar 2009 at 8:01

GoogleCodeExporter commented 9 years ago

Original comment by zwetan on 18 Nov 2009 at 10:08

GoogleCodeExporter commented 9 years ago
You could possibly use a Dictionary, or else just set the array element to null
rather than splicing it out.

Original comment by Aarobe...@gmail.com on 9 Jan 2010 at 4:20

GoogleCodeExporter commented 9 years ago
you can access the requests array and the method clearRequests() from anything 
implementing the AnalyticsTracker interface (eg. GATracker)

Alos, now when the GA API call resetSession() it call the GIFRequest 
clearRequests() method

Original comment by zwetan on 30 Apr 2012 at 10:06