Provides a hint that an image will no longer be accessed from a reference in user space. The results are equivalent to those that occur when the program loses its last reference to this image, the garbage collector discovers this, and finalize is called. This can be used as a hint in situations where waiting for garbage collection would be overly conservative, e.g., there are a large number of socket connections which may be opened to transmit tile data.
SerializableRenderedImage
defines this method to behave as follows:
- if the image is acting as a server, i.e., has never been serialized and may be providing data to serialized versions of itself, it makes itself unavailable to further client requests and closes its socket;
- if the image is acting as a client, i.e., has been serialized and may be requesting data from a remote, pre-serialization version of itself, it sends a message to its remote self indicating that it will no longer be making requests.
The results of referencing an image after a call to dispose()
are undefined.