Thanks ...
But I still confuse that why "subclasses" is not used anywhere in this
code.
I think there's only one possibility that is keeping a reference count to
this new "klass". However, if user has to use the "klass" in the future,
user may save it to a new variable ...
Regards,
Erwin
On Tuesday, July 31, 2012 12:22:18 AM UTC+8, Victor wrote:
>
> Please note line 65 and 70 which define an Array as "subclasses"
>> and push content into it. However, I'm grepped whole codes and it seems
>> this variable is not used anywhere. On the other hand, it will cause the
>> created "klass" is referenced by parent and is never freed by Garbage
>> Collection. If I run this function repeatedly:
>>
>> function() {
>> var klass = Class.create(parent);
>> }
>>
>> It will cause memory leak because klass is referenced by parent.
>>
>> It is not memory leak. Your code may create new class instances or new
> subclasses at any time. If you have created millions of classes and want to
> "forget" some class to free some memory then you are probably doing
> something wrong.
>
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/e1z916V9OCsJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.