darshb / gdata-objectivec-client

Automatically exported from code.google.com/p/gdata-objectivec-client
Other
0 stars 0 forks source link

setUserAgent leaks #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Alloc and init a GDataServiceGoogleYoutube
2. set the userAgent ([gDataService
setUserAgent:@"MyAppMyCompany-IPhone-1.0"];)
3. Use the service, (run with leaks)

What is the expected output? What do you see instead?
I have a leak in a general-block-48... I don't if I don't change the userAgent

What version of the product are you using? On what operating system?
I'm using version 1.8.0 on the iPhone OS 3.1

It seems that the leaks start from GDataUtilities.m at line 90.

Regards,
Romain

Original issue reported on code.google.com by romain.p...@gmail.com on 16 Aug 2009 at 2:38

GoogleCodeExporter commented 9 years ago
I forgot to say that you may need to release the service to have the leak.

Regards

Original comment by romain.p...@gmail.com on 16 Aug 2009 at 2:39

GoogleCodeExporter commented 9 years ago
I suspect you're seeing lazy allocation of the static local variable 
filterChars in
stringWithControlsFilteredForString:, not a leak.  That allocation happens the 
first
time setUserAgent: is called, but will not happen again no matter how many times
setUserAgent: is called.

Original comment by gregrobbins on 16 Aug 2009 at 4:00

GoogleCodeExporter commented 9 years ago
Yes you must be right.
but then why does instruments detects it as a leak?

If I understand well, if I instanciate another service, and set the userAgent, 
then
release my service, the first "leak" won't show up again?

Thank you for your answer,
Regards

Original comment by romain.p...@gmail.com on 16 Aug 2009 at 4:10

GoogleCodeExporter commented 9 years ago
Right, it's not a leak unless it shows up repeatedly. I do not know what 
algorithm
Instruments is using. Please let us know if you think there remains an issue.

Original comment by gregrobbins on 18 Aug 2009 at 10:56