Search Issue Tracker

Fixed in 4.6.1

Votes

0

Found in

4.5.3f3

Issue ID

632166

Regression

No

Memory leak in WWW class on iOS

iOS

-

CFURLRequest, a NSMutableURLRequest and a NSURLRequestInternal objects are not released from memory in the cleanup function.

After implementing the changes to the cleanup function in WWWConnection.mm suggested by the user (in the initial report), the total memory consumption falls by about 30mb when creating 10 000 WWW objects.

Comments (9)

  1. Monarc

    Dec 20, 2018 10:43

    This still occur in 5.6.5

  2. fourdesire

    Dec 25, 2016 13:40

    This happened again in 5.5.0 ios 10

    and can be fixed by

    Change the line
    NSMutableString* headerString = [NSMutableString stringWithCapacity:1024];

    to
    NSMutableString* headerString = [[NSMutableString stringWithCapacity:1024] retain];

  3. htudrshtsrhtsthsht

    Oct 27, 2014 08:28

    I had the same problem (memory leak on WWW request), see thread:

    http://answers.unity3d.com/answers/818219/view.html

    and bug report:

    http://fogbugz.unity3d.com/default.asp?642466_u3apn704bp9ko5q7

  4. htudrshtsrhtsthsht

    Oct 27, 2014 08:27

  5. mason2014

    Oct 22, 2014 02:45

    Cause a crash when release WWW object,please fix it as soon

  6. DimensionU

    Oct 17, 2014 19:07

    I'm seeing the same crash reported by JamesMilkCap. I can also confirm that GrahamReeves' suggestion does eliminate the crash.

  7. GrahamReeves

    Oct 17, 2014 12:20

    This can be fixed in the trampoline code,

    in iPhone-Trampoline/Classes/Unity/WWWConnection.mm, line 134
    didReceiveResponse

    Change the line
    NSMutableString* headerString = [NSMutableString stringWithCapacity:1024];

    to
    NSMutableString* headerString = [[NSMutableString stringWithCapacity:1024] retain];

  8. Tommi-Kiviniemi

    Oct 17, 2014 10:57

    Same here. In our case it is a fetch request for getting Facebook friends (through the FB API) that is crashing once the WWW object is being cleaned up.

    Please fix this in the next patch release for 4.5.5 as 4.5.5p1 is totally unusable due to this.

  9. jamesmilkcap

    Oct 17, 2014 09:28

    Seeing a crash that's being caused by this fix (in 4.5.5 p1).

    Here's a screenshot:

    https://lh3.googleusercontent.com/-ak9kqr2HNsw/VEALrDHR1SI/AAAAAAAAANs/Mgm4C7C7Qmo/w1359-h954-no/GameCenterCrash.png

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.