亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
久国产精品韩国三级视频| 一区二区欧美视频| 欧美无人高清视频在线观看| 捆绑调教一区二区三区| 亚洲午夜成aⅴ人片| 亚洲伦理在线精品| 国产日韩欧美高清| 91麻豆精品国产91久久久更新时间 | 综合久久给合久久狠狠狠97色| 国产+成+人+亚洲欧洲自线| 亚洲国产一区二区三区青草影视| 日韩欧美成人激情| 日韩一区二区在线看| 制服丝袜国产精品| 中文字幕欧美日韩一区| 五月天国产精品| 国产丶欧美丶日本不卡视频| 亚洲高清免费在线| 国产91清纯白嫩初高中在线观看 | 色丁香久综合在线久综合在线观看| 亚洲青青青在线视频| 精品裸体舞一区二区三区| 欧美日韩精品一二三区| 91美女视频网站| 色综合久久久久综合体桃花网| 欧美aaa在线| 蜜臀va亚洲va欧美va天堂| 亚洲一区二区三区在线播放| 国产精品久久久久影院色老大| 欧美日韩国产一级片| 欧美主播一区二区三区| 欧美三级蜜桃2在线观看| 欧美伊人精品成人久久综合97| 国产激情一区二区三区桃花岛亚洲| 丝袜美腿亚洲一区二区图片| 色综合欧美在线视频区| 精品视频在线免费观看| 日韩三级视频中文字幕| 国产精品久久久久影视| 亚洲国产日韩一级| 国产成人精品亚洲777人妖| 91丨porny丨在线| 日韩精品在线看片z| 亚洲美腿欧美偷拍| 精品一区二区免费视频| 色噜噜狠狠色综合中国| 欧美精品一区二区精品网| 亚洲国产视频在线| 国产精品影视天天线| 欧美日韩色综合| 1024成人网| 成人国产精品免费观看动漫| 日韩欧美国产高清| 亚洲午夜免费视频| 成人久久18免费网站麻豆| 欧美草草影院在线视频| 天天影视色香欲综合网老头| 色域天天综合网| 一区二区三区免费观看| 国产91丝袜在线观看| 风间由美一区二区av101| 国产欧美一区二区精品忘忧草| 久久精品国产精品亚洲红杏| 日本一区二区三区电影| 91成人免费在线视频| 日韩中文字幕区一区有砖一区 | 国产亚洲欧美一级| 精品一区免费av| 精品国产91亚洲一区二区三区婷婷| 一区二区激情视频| 欧美日韩黄色影视| 日日嗨av一区二区三区四区| 欧美一区二区视频网站| 老司机午夜精品| 精品久久人人做人人爽| 懂色av一区二区在线播放| 国产三级欧美三级日产三级99 | 美女久久久精品| 26uuu另类欧美亚洲曰本| 成人免费高清视频在线观看| 亚洲伦理在线免费看| 3d动漫精品啪啪一区二区竹菊| 亚洲人成在线播放网站岛国| 色天使久久综合网天天| 视频一区在线播放| 中文字幕精品一区二区三区精品| 国产精品一区二区不卡| 欧美国产欧美综合| 99久久久国产精品免费蜜臀| 亚洲无人区一区| 久久久久国产精品免费免费搜索| 精品影院一区二区久久久| 亚洲美女电影在线| 欧美美女黄视频| 91免费观看国产| 精品午夜一区二区三区在线观看| 国产欧美日韩视频一区二区| 欧美调教femdomvk| 成人av在线一区二区三区| 麻豆国产欧美日韩综合精品二区 | 欧美aa在线视频| 一区二区三区久久| 久久精品免视看| 日韩欧美国产综合在线一区二区三区| 日精品一区二区三区| 一区二区三区中文字幕电影| 国产午夜亚洲精品午夜鲁丝片 | 欧美成人高清电影在线| 日韩限制级电影在线观看| 91麻豆精品国产91久久久资源速度 | 狠狠色狠狠色合久久伊人| 久久久综合视频| 精品欧美乱码久久久久久| 日韩欧美国产高清| 欧美日本乱大交xxxxx| 91色视频在线| eeuss鲁片一区二区三区在线看| 玉足女爽爽91| 一区二区三区在线观看网站| 国产精品久久久久久妇女6080| 4hu四虎永久在线影院成人| 欧美日韩不卡一区二区| 91精品国产综合久久婷婷香蕉| 色综合久久综合网97色综合| 一本色道久久综合亚洲精品按摩| 国产乱人伦精品一区二区在线观看 | 国产欧美日韩麻豆91| 久久精品亚洲一区二区三区浴池| 欧美三级三级三级| 日韩无一区二区| 26uuuu精品一区二区| 中文字幕 久热精品 视频在线| 精品乱码亚洲一区二区不卡| 欧美—级在线免费片| 亚洲三级理论片| 蜜臀av性久久久久蜜臀aⅴ四虎 | 国产精品99久久久久久似苏梦涵| 久久aⅴ国产欧美74aaa| 国产精品资源站在线| 在线亚洲精品福利网址导航| 欧美一卡二卡三卡四卡| 国产日韩欧美精品一区| 日韩在线一二三区| 国产一区二区精品久久91| 国产高清在线精品| 欧美日韩在线免费视频| 亚洲v精品v日韩v欧美v专区| 久久99精品一区二区三区三区| 激情丁香综合五月| 欧美中文字幕不卡| 国产午夜精品一区二区三区视频 | 3d成人h动漫网站入口| 91豆麻精品91久久久久久| 欧美tickle裸体挠脚心vk| 亚洲人妖av一区二区| 国内久久婷婷综合| 欧美午夜精品久久久| 国产精品乱人伦中文| 激情伊人五月天久久综合| 欧美吞精做爰啪啪高潮| 亚洲男人的天堂在线aⅴ视频| 蜜桃久久久久久久| 欧美日韩精品一区视频| 国产一区二区视频在线播放| 欧美亚洲国产一区二区三区va| 久久久www成人免费无遮挡大片| 亚洲成av人片在www色猫咪| 99久久伊人网影院| 国产精品理伦片| www.一区二区| 亚洲欧美偷拍三级| 在线视频中文字幕一区二区| 中文字幕日韩av资源站| www.一区二区| 有坂深雪av一区二区精品| 在线视频中文字幕一区二区| 亚洲国产日韩a在线播放性色| 成熟亚洲日本毛茸茸凸凹| 欧美变态口味重另类| 国产在线观看一区二区 | 欧美系列一区二区| 亚洲成人自拍一区| 日韩欧美久久一区| 国产一区二区三区| 国产精品私人影院| 欧美色图天堂网| 蓝色福利精品导航| 综合av第一页| 欧美一区二区视频在线观看 | 国产成人av在线影院| 亚洲免费视频中文字幕| 7777精品伊人久久久大香线蕉经典版下载 | 久久av资源站| 亚洲四区在线观看| 亚洲精品一线二线三线无人区| 日本午夜一区二区| 久久久精品综合| 欧美久久久久久久久中文字幕| 日韩国产欧美在线视频| 国产精品久久看|