-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Allow cleanup of an object through a destructor or dispose method #3691
Copy link
Copy link
Closed
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.closed-obsoleteClosed as the reported issue is no longer relevantClosed as the reported issue is no longer relevantcore-nlibrary-coretype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.closed-obsoleteClosed as the reported issue is no longer relevantClosed as the reported issue is no longer relevantcore-nlibrary-coretype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Type
Fields
Give feedbackNo fields configured for issues without a type.
This issue was originally filed by Don.J.Olmstea...@gmail.com
Dart should have a destructor or dispose method <http://msdn.microsoft.com/en-us/library/fs2xkftw.aspx>, for when an object is marked to be collected.
To give a use case where this would be useful lets say you had a Texture class which contains a WebGLTexture. When you're done using
the WebGLTexture it should be disposed of by calling deleteTexture
through a WebGLRenderingContext. So if you were sharing this Texture
between other objects it isn't entirely clear when its okay to call
deleteTexture. A destructor or dispose method would provide a clear place to call deleteTexture safely.
Having a destructor or dispose method could also be of use for those trying to embed Dart in a C/C++ program.