This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 18610 - Transferable should expose a close() method
Summary: Transferable should expose a close() method
Status: RESOLVED WONTFIX
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Web Messaging (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-17 22:21 UTC by Glenn Maynard
Modified: 2012-10-19 21:25 UTC (History)
4 users (show)

See Also:


Attachments

Description Glenn Maynard 2012-08-17 22:21:08 UTC
Every Transferable object is neuterable.  Neutering is useful in cases other than transferring.

For example, being able to programmatically neuter a large ArrayBuffer when you're finished performing computations in it would be useful, to give the UA the option of freeing the memory associated with it immediately instead of waiting for GC.

Any object big enough for Transferable to be useful (aside from MessagePort, which is a minor anomaly) is also big enough for close() to be useful.  Instead of APIs handling this one by one, this should simply be supported for all Transferables.

This should be no burden for any API supporting Transferable, since they already have to do the work of implementing the "neuter" concept.

(MessagePort already has a close() method.  It would be nice if its behavior could be aligned with Transferable.close(), so they can be the same method.)
Comment 1 Ian 'Hixie' Hickson 2012-10-19 21:25:23 UTC
You don't need to close a large object. Just forget the object and let it GC.