docs: Explain why destroy() is implemented

As destroy() is Clutter-specific and not generic
GObject code, explain why we implement it
(rather than dispose()).
This commit is contained in:
Elliot Smith 2011-01-31 13:39:11 +00:00
parent e69d60e8b6
commit 885664f725

View File

@ -203,6 +203,31 @@
<itemizedlist> <itemizedlist>
<listitem>
<formalpara>
<title>Object destruction:
<function>cb_button_destroy()</function></title>
<para><type>ClutterActor</type> subclasses based
on composition should implement the <function>destroy()</function>
virtual function. This is called on an actor when its
container is destroyed to clean up the resources
allocated to the actor; it also emits a
<emphasis>destroy</emphasis> signal which other code can
hook onto.</para>
</formalpara>
<para>In the case of <type>CbButton</type>, the
<function>destroy()</function> implementation calls
<function>clutter_actor_destroy()</function> on the child
<type>ClutterBox</type>, then sets that child to
<constant>NULL</constant>. Finally, it checks for a
<function>destroy()</function> implementation on the parent
class, then calls it if one exists.</para>
</listitem>
<listitem> <listitem>
<formalpara> <formalpara>