亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sec-finalization.html

?? gtk_text program sample&eg
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html>  <head>    <title>      Object Finalization    </title>    <meta name="GENERATOR" content=    "Modular DocBook HTML Stylesheet Version 1.45">    <link rel="HOME" title="GTK+ / Gnome Application Development"    href="ggad.html">    <link rel="UP" title="The GTK+ Object and Type System" href=     "cha-objects.html">    <link rel="PREVIOUS" title="Signals" href="z109.html">    <link rel="NEXT" title="Attaching Data to Objects" href=     "sec-objectdata.html">  </head>  <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink=   "#840084" alink="#0000FF">    <div class="NAVHEADER">      <table width="100%" border="0" bgcolor="#ffffff" cellpadding=       "1" cellspacing="0">        <tr>          <th colspan="4" align="center">            <font color="#000000" size="2">GTK+ / Gnome Application            Development</font>          </th>        </tr>        <tr>          <td width="25%" bgcolor="#ffffff" align="left">            <a href="z109.html"><font color="#0000ff" size="2"><b>            &lt;&lt;&lt; Previous</b></font></a>          </td>          <td width="25%" colspan="2" bgcolor="#ffffff" align=           "center">            <font color="#0000ff" size="2"><b><a href="ggad.html">            <font color="#0000ff" size="2"><b>            Home</b></font></a></b></font>          </td>          <td width="25%" bgcolor="#ffffff" align="right">            <a href="sec-objectdata.html"><font color="#0000ff"            size="2"><b>Next &gt;&gt;&gt;</b></font></a>          </td>        </tr>      </table>    </div>    <div class="SECT1">      <h1 class="SECT1">        <a name="SEC-FINALIZATION">Object Finalization</a>      </h1>      <p>        To write a <span class="STRUCTNAME">GtkObject</span>, you        must implement the methods provided by the <span class=         "STRUCTNAME">GtkObject</span> interface, or at least be        sure you are happy with the default implementations. There        are only five <span class="STRUCTNAME">GtkObject</span>        methods; two of them are <span class="STRUCTNAME">        get_arg</span> and <span class="STRUCTNAME">set_arg</span>,        described in <a href="hc-objectargs.html#SEC-GETSETARG">the        section called <i>Using Object Arguments in Your Own <span        class="STRUCTNAME">GtkObject</span> Subclass</i></a>. The        other three implement object destruction; here are the        fields in <span class="STRUCTNAME">GtkObjectClass</span>:      </p>      <table border="0" bgcolor="#E0E0E0" width="100%">        <tr>          <td><pre class="PROGRAMLISTING">&#13;  void (* shutdown) (GtkObject *object);  void (* destroy)  (GtkObject *object);    void (* finalize) (GtkObject *object);&#13;</pre>          </td>        </tr>      </table>      <p>        As you might guess from this, objects are destroyed in a        three-stage process. Each method represents one stage in        the process; if your object subclass overrides any of them,        it must "chain up" to the corresponding method in the        parent class (see <a href=        "sec-finalization.html#SEC-CHAINUP">the section called <i>        Chaining Up</i></a>). The three methods do the following:      </p>      <ul>        <li>          <p>            The <span class="STRUCTNAME">shutdown</span> method            allows objects to perform actions before destruction            begins. Most subclasses do not override this method;            the default <span class="STRUCTNAME">shutdown</span>            method emits the <span class="SYMBOL">"destroy"</span>            signal to start the next phase. (The default            implementation will <i class="EMPHASIS">always</i> be            invoked, even if overridden, because subclasses are            required to "chain up.")&#13;          </p>        </li>        <li>          <p>            The <span class="STRUCTNAME">destroy</span> method            marks the object "useless" and cleans up associated            resources, but does not free the object itself.            Typically a destroy method would free data, strings,            and so on stored in the instance struct, and set the            struct members to <span class="STRUCTNAME">NULL</span>.            This is the method most subclasses override.&#13;          </p>        </li>        <li>          <p>            The <span class="STRUCTNAME">finalize</span> method is            invoked <i class="EMPHASIS">only when the object's            reference count reaches 0</i>. The default            implementation frees the object instance struct, so            that further attempts to use the object result in a            segmentation fault. The <span class="STRUCTNAME">            finalize</span> method must also consider that user            code could have been invoked after the <span class=             "STRUCTNAME">destroy</span> method, and free any data            that user code could have allocated. &#13;          </p>        </li>      </ul>      <p>        Note: <i class="EMPHASIS">Objects can be destroyed        regardless of their reference count</i>. This means that        the <span class="STRUCTNAME">shutdown</span> method is        invoked and the <span class="STRUCTNAME">destroy</span>        signal is emitted. However, as long as the reference count        is greater than 0, the object will not be <i class=        "EMPHASIS">finalized</i>.      </p>      <p>        The <span class="STRUCTNAME">shutdown</span> method has no        defined role; its purpose depends on the particular object.        For example, the <tt class="CLASSNAME">GtkWidget</tt>        shutdown implementation removes the widget from its parent        container, and unrealizes the widget. This is especially        important for containers: their <span class="STRUCTNAME">        destroy</span> method destroys all children of the        container. If the container was not unrealized before        destruction, it would still be visible and the user would        see each child disappear, followed by the container. With        the <span class="STRUCTNAME">shutdown</span> method,        everything disappears at once.      </p>      <p>        The <span class="STRUCTNAME">destroy</span> method frees as        many resources as possible without rendering the object        "unsafe." If your object has invariants describing its        integrity, a <span class="STRUCTNAME">destroy</span> method        will not violate them. All public functions exported by an        object implementation should gracefully handle destroyed        objects (they should not crash---remember that an object        can be destroyed while references to it persist). The <span        class="STRUCTNAME">finalize</span> method actually frees        the object, meaning that attempts to use the object become        dangerous bugs.      </p>      <p>        The statement that "public functions exported by an object        implementation should gracefully handle destroyed objects"        requires some qualification. This is the intended behavior;        otherwise, code could not ensure the sanity of an object by        increasing its reference count. However, the implementation        does not yet live up to the guarantee in all cases. Some        public functions in GTK+ and Gnome still assume data        structures freed in the destroy method exist, or        re-allocate data structures the destroy method already        freed. Unless the finalize method re-frees those data        structures, they will be leaked. To avoid these bugs, it is        best to avoid calling functions on destroyed objects (in        practice, it would be uncommon to do so).      </p>      <p>        You <i class="EMPHASIS">can</i> count on being able to        check the type and object flags of a destroyed object,        however; and it is certainly safe to call <tt class=         "FUNCTION">gtk_object_unref()</tt> on a destroyed object.        In your own object implementations, be sure you implement        each public function correctly; check whether the object is        destroyed with <tt class="FUNCTION">        GTK_OBJECT_DESTROYED()</tt>, and keep in mind that user        code can run between the <span class="STRUCTNAME">        destroy</span> method and the <span class="STRUCTNAME">        finalize</span> method.      </p>      <p>        Notice that the <span class="STRUCTNAME">destroy</span>        method is the default handler for a <span class="SYMBOL">        "destroy"</span> signal, but the <span class="STRUCTNAME">        shutdown</span> and <span class="STRUCTNAME">        finalize</span> methods are class functions only. This        reduces the complexity and increases the speed of the        finalization process. Also, because <span class=        "STRUCTNAME">finalize</span> destroys the integrity of an        object, it would be unsafe to emit as a signal (GTK+ does        have a facility called "weak references" that allows you to        invoke a callback when an object is finalized---weak        references do not assume that the <span class="STRUCTNAME">        GtkObject</span> is in a sane state).      </p>      <p>        To make things more concrete, let's look at the functions        you would use to destroy an object. First, <tt class=         "FUNCTION">gtk_object_destroy()</tt>:      </p>      <table border="0" bgcolor="#E0E0E0" width="100%">        <tr>          <td><pre class="PROGRAMLISTING">&#13;voidgtk_object_destroy (GtkObject *object){  g_return_if_fail (object != NULL);  g_return_if_fail (GTK_IS_OBJECT (object));  g_return_if_fail (GTK_OBJECT_CONSTRUCTED (object));    if (!GTK_OBJECT_DESTROYED (object))    {      gtk_object_ref (object);      object-&gt;klass-&gt;shutdown (object);      gtk_object_unref (object);    }}&#13;</pre>          </td>        </tr>      </table>      <p>        Notice that destroyed-but-not-finalized objects are        flagged, and this flag can be checked with the <tt class=         "FUNCTION">GTK_OBJECT_DESTROYED()</tt> macro. <tt class=         "FUNCTION">gtk_object_destroy()</tt> ensures that objects        are not destroyed twice by ignoring any already-destroyed        objects. If an object has not been destroyed, <tt class=         "FUNCTION">gtk_object_destroy()</tt> references it to        prevent finalization during the destroy process and invokes        the shutdown method; by default, that method looks like        this:      </p>      <table border="0" bgcolor="#E0E0E0" width="100%">        <tr>          <td><pre class="PROGRAMLISTING">&#13;static voidgtk_object_shutdown (GtkObject *object){  GTK_OBJECT_SET_FLAGS (object, GTK_DESTROYED);  gtk_signal_emit (object, object_signals[DESTROY]);}&#13;</pre>          </td>        </tr>      </table>      <p>        This method sets the destroyed flag, to ensure that any        recursive <tt class="FUNCTION">gtk_object_destroy()</tt>        calls have no effect; then it emits the <span class=        "SYMBOL">"destroy"</span> signal. <tt class="FUNCTION">        gtk_object_shutdown()</tt> seems pointless by itself;        however, subclasses may override this method with something        more substantial, chaining up to the <span class=        "STRUCTNAME">GtkObject</span> default method (see <a href=         "sec-finalization.html#SEC-CHAINUP">the section called <i>        Chaining Up</i></a>).      </p>      <p>        It may be unclear that <tt class="FUNCTION">        gtk_object_shutdown()</tt> is a method implementation,        while <tt class="FUNCTION">gtk_object_destroy()</tt> is a        public function. Note that <tt class="FUNCTION">        gtk_object_shutdown()</tt> is the internal function that        implements the <span class="STRUCTNAME">shutdown</span>        method for the <span class="STRUCTNAME">GtkObject</span>        class, while <tt class="FUNCTION">gtk_object_destroy()</tt>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久99久久免费精品蜜臀| 日韩中文字幕麻豆| 国产福利一区二区三区视频| 久久美女艺术照精彩视频福利播放| 视频在线观看国产精品| 91精品一区二区三区久久久久久 | av在线不卡免费看| 国产精品嫩草影院com| 99re6这里只有精品视频在线观看| 亚洲精品免费电影| 欧美一卡2卡三卡4卡5免费| 国内一区二区在线| 中文字幕av资源一区| 91美女福利视频| 视频精品一区二区| 欧美tickling网站挠脚心| 国产成人av福利| 亚洲蜜臀av乱码久久精品蜜桃| 欧美视频一区在线观看| 久久精品国产久精国产爱| 中文字幕的久久| 欧美三级三级三级爽爽爽| 激情文学综合网| 亚洲欧美在线观看| 欧美一级精品大片| 91亚洲精品久久久蜜桃| 日韩电影一区二区三区| 日本一区二区免费在线观看视频 | 欧美婷婷六月丁香综合色| 精品在线观看视频| 亚洲欧美怡红院| 日韩欧美不卡一区| 99re视频精品| 精品夜夜嗨av一区二区三区| 亚洲三级在线免费观看| 欧美一区二区美女| 91同城在线观看| 精品制服美女久久| 亚洲成人免费影院| 欧美国产精品一区二区三区| 91精品黄色片免费大全| 91一区二区三区在线观看| 国内偷窥港台综合视频在线播放| 亚洲女人小视频在线观看| 精品久久国产97色综合| 欧美性猛片xxxx免费看久爱| 国产91色综合久久免费分享| 日日夜夜精品视频天天综合网| 国产精品久久久久久久久久免费看 | 欧美精品色综合| 成人白浆超碰人人人人| 麻豆精品一区二区综合av| 一区二区三区在线影院| 久久久久久一二三区| 欧美乱熟臀69xxxxxx| 97久久精品人人爽人人爽蜜臀| 国产一区二区调教| 日日夜夜精品免费视频| 亚洲一区二区三区四区的| 国产精品久久久久影院色老大| 欧美xfplay| 欧美一区二区三区性视频| 欧美系列一区二区| 91免费国产视频网站| 成人性视频免费网站| 国产精一品亚洲二区在线视频| 奇米精品一区二区三区四区 | 久久一区二区三区国产精品| 日韩一区二区高清| 欧美日韩电影在线播放| 欧美私模裸体表演在线观看| 91香蕉视频mp4| 99久久99久久久精品齐齐| 波多野结衣一区二区三区| 国产成人免费高清| 国产精品18久久久久久久网站| 国产主播一区二区三区| 精品在线一区二区| 国产乱对白刺激视频不卡| 国产一区二区三区免费在线观看| 麻豆精品在线视频| 加勒比av一区二区| 国产揄拍国内精品对白| 国产精品一区二区三区99| 国产精品99久久久久久似苏梦涵 | 美女脱光内衣内裤视频久久网站 | 91成人在线观看喷潮| 日本道精品一区二区三区| 欧美色男人天堂| 欧美老女人第四色| 2024国产精品| 中文子幕无线码一区tr| 国产精品网站在线播放| 亚洲色图20p| 日韩成人精品在线| 美女视频黄久久| 国产一区二区视频在线| 成人精品高清在线| 91福利视频久久久久| 欧美色图片你懂的| 日韩女同互慰一区二区| 国产欧美日韩精品一区| 亚洲欧洲美洲综合色网| 亚洲成在线观看| 精品一区二区三区在线观看 | 91污片在线观看| 在线不卡欧美精品一区二区三区| 欧美成人激情免费网| 中文字幕欧美三区| 亚洲一区二区三区视频在线 | 久久久久久久久久久99999| 日本一区二区高清| 午夜精品一区二区三区三上悠亚 | 欧美96一区二区免费视频| 韩国av一区二区三区在线观看| 91在线无精精品入口| 欧美久久久久久久久| 久久毛片高清国产| 亚洲va天堂va国产va久| 国产精品亚洲а∨天堂免在线| 在线精品视频一区二区三四 | 91在线视频免费观看| 欧美放荡的少妇| 国产精品电影院| 日本中文字幕一区| 91蝌蚪porny成人天涯| 日韩免费在线观看| 一区二区三区四区乱视频| 精久久久久久久久久久| 色88888久久久久久影院按摩 | 国产精品国产三级国产普通话99| 香蕉久久一区二区不卡无毒影院 | 99精品一区二区三区| 欧美理论片在线| 亚洲免费伊人电影| 国产精品自拍一区| 欧美男生操女生| 亚洲日本在线观看| 国产成人免费在线观看不卡| 91麻豆精品国产91久久久使用方法| 亚洲人午夜精品天堂一二香蕉| 激情综合色综合久久综合| 欧美亚洲自拍偷拍| 亚洲欧美日韩国产一区二区三区| 六月丁香婷婷久久| 欧美日韩国产色站一区二区三区| 1000精品久久久久久久久| 久久97超碰国产精品超碰| 欧美日韩在线不卡| 亚洲欧美日韩国产综合在线| 成人av电影在线观看| 久久婷婷色综合| 麻豆精品在线播放| 717成人午夜免费福利电影| 伊人一区二区三区| 不卡一区在线观看| 久久久精品国产99久久精品芒果 | 一本大道久久a久久精二百| 久久精品夜色噜噜亚洲aⅴ| 免费在线观看不卡| 69p69国产精品| 青草av.久久免费一区| 欧美日韩久久久| 午夜视频在线观看一区二区三区| 欧美主播一区二区三区美女| 亚洲国产精品视频| 欧美日本在线观看| 五月综合激情婷婷六月色窝| 欧美久久一二区| 免费成人小视频| 久久久青草青青国产亚洲免观| 精品一区二区日韩| 久久精品视频一区二区三区| 国产高清精品在线| 中文字幕一区二区不卡 | av成人老司机| 精品国产凹凸成av人网站| 美女免费视频一区二区| 正在播放亚洲一区| 另类中文字幕网| 久久久久久影视| 国产69精品久久99不卡| 国产精品家庭影院| 北条麻妃国产九九精品视频| 久久久久久久综合色一本| 乱一区二区av| 国产精品无码永久免费888| 成人激情免费电影网址| 中文字幕不卡在线播放| 91麻豆成人久久精品二区三区| 亚洲男人的天堂av| 欧美亚日韩国产aⅴ精品中极品| 日韩成人一级片| 精品免费国产二区三区| 精品在线一区二区三区| 亚洲精品在线电影| 国产成人小视频| 国产精品久久久久影院色老大 | 99视频精品在线| 亚洲第一电影网|