I think even in Java there are few cases where you should rely on finalize.
Actualy you should not rely on it at all ....

2012/8/24 Harold Comere <[email protected]>

> Hi,
>
> Thank you for answers !
>
> I am using GWT for 3D purpose with WebGL.
> When i am destroying an object from the 3D scene, i have to free
> associated webgl objects to manage GPU memory.
>
> Some webgl objects are shared between many objects, so i need to destroy
> the gl objects only when they are not used by any other object.
> In JAVA, the finalize() method done the trick as the garbage collector
> checks references to destroy unused objects.
>
> If JavaScript do not do that, i think i have to do a kind of smart pointer
> by myself.
>
> Regards,
> Harold
>
> 2012/8/24 Joseph Lust <[email protected]>
>
>> Generally speaking, there is no reason you should need finalize either as
>> it is a anti-pattern in all but a very few cases. However, for items like
>> widgets, you can do cleanup in the OnDetach and OnUnload methods.
>>
>>
>> Sincerely,
>> Joseph
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Web Toolkit" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/google-web-toolkit/-/-io17mCbyCEJ.
>>
>> 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/google-web-toolkit?hl=en.
>>
>
>
>
> --
> *Small WebGL 3D engine for GWT*
> *http://code.google.com/p/ethereal-engine/*<http://code.google.com/p/ethereal-engine/>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> 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/google-web-toolkit?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
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/google-web-toolkit?hl=en.

Reply via email to