core :: Finalizable
It is recommended to sub-class Finalizable
only on
simple objects directly managing a limited resource. This use case
is common when wrapping an extern instance with a standard object.
core :: Finalizable :: defaultinit
core :: Finalizable :: finalize
Liberate any resources held byself
before the memory holding self
is freed
core $ Finalizable :: SELF
Type of this instance, automatically specialized in every classcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Finalizable :: defaultinit
core :: Object :: defaultinit
core :: Finalizable :: finalize
Liberate any resources held byself
before the memory holding self
is freed
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).app :: HttpRequestClientWindow
Simple window with a label and a buttonapp :: MyHttpRequest
Simple asynchronous HTTP request to http://example.com/ displaying feedback to the windowAsyncHttpRequest
where uri
is an attribute
# An object needing finalization
#
# It is recommended to sub-class `Finalizable` only on
# simple objects directly managing a limited resource. This use case
# is common when wrapping an extern instance with a standard object.
class Finalizable
# Liberate any resources held by `self` before the memory holding `self` is freed
#
# This method is invoked by the GC during a garbage collection when `self`
# is no longer referenced. It can also be called by the user. Its implementation
# must be planned accordingly and ensure that it may be invoked more than once.
#
# The object are not finialized in a topological order, it is safe for this method
# to use attributes of this instances, unless theses attributes are finalizable as well
# because they may have been finalized already.
fun finalize do end
end
lib/core/gc.nit:21,1--38,3