~ubuntu-branches/ubuntu/trusty/libbonobo/trusty-proposed

« back to all changes in this revision

Viewing changes to doc/api/html/refcounting.html

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-09-17 16:38:13 UTC
  • mfrom: (1.1.16 upstream)
  • Revision ID: james.westby@ubuntu.com-20070917163813-sg2l3nt1q6s3lybq
Tags: 2.20.0-0ubuntu1
* New upstream version:
  - Add unit test for bug 427992.
  - Align configure switches
  - Updated translations

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
<head>
4
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5
5
<title>Reference Counting</title>
6
 
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
7
<link rel="start" href="index.html" title="Libbonobo Reference Manual">
8
8
<link rel="up" href="factories.html" title="Objects, Factories, Reference Counting">
9
9
<link rel="prev" href="libbonobo-bonobo-shlib-factory.html" title="bonobo-shlib-factory">
30
30
<div class="refentry" lang="en">
31
31
<a name="refcounting"></a><div class="titlepage"></div>
32
32
<div class="refsect1" lang="en">
33
 
<a name="id2592089"></a><h2>Reference Counting</h2>
 
33
<a name="id3074809"></a><h2>Reference Counting</h2>
34
34
<p>
35
35
            Bonobo component reference counting, version 0.1
36
36
            by  Michael Meeks &lt;mmeeks@gnu.org&gt;
37
37
            and Mike Fleming &lt;mfleming@eazel.com&gt;
38
38
        </p>
39
39
<div class="refsect2" lang="en">
40
 
<a name="id2592101"></a><h3>Bonobo Objects</h3>
 
40
<a name="id3074820"></a><h3>Bonobo Objects</h3>
41
41
<p>
42
42
                A bonobo object is a glib object that implements an
43
43
                CORBA interface, it also contains a pointer to the
69
69
</div>
70
70
<hr>
71
71
<div class="refsect2" lang="en">
72
 
<a name="id2592758"></a><h3>Ref counting</h3>
 
72
<a name="id3075478"></a><h3>Ref counting</h3>
73
73
<p> The only ref count to manipulate is that on the
74
74
                aggregate obejct, this is done via the
75
75
                <code class="function">bonobo_object_ref / unref</code> pair,
92
92
</div>
93
93
<hr>
94
94
<div class="refsect2" lang="en">
95
 
<a name="id2592810"></a><h3>Reference leaks</h3>
 
95
<a name="id3075529"></a><h3>Reference leaks</h3>
96
96
<p>
97
97
                Catching reference leaks is evily difficult. The first
98
98
                approach is to set environment variable
113
113
                which object is not getting freed---is to fire up
114
114
                container and component in gdb, break in
115
115
                eg. bonobo_embeddable_new and insert a hardware watch
116
 
                point on the ref count [ see also <a href="debugging.html" title="Debugging"><span class="refentrytitle">Debugging</span></a> ]:</p>
 
116
                point on the ref count [ see also <a class="xref" href="debugging.html" title="Debugging"><span class="refentrytitle">Debugging</span></a> ]:</p>
117
117
<pre class="programlisting">
118
118
(gdb) p &amp;((BonoboObject *)embeddable)-&gt;priv-&gt;ao-&gt;ref_count
119
119
$N = (int *) 0x80808102
129
129
</div>
130
130
<hr>
131
131
<div class="refsect2" lang="en">
132
 
<a name="id2592884"></a><h3>Ref Counting Conventions</h3>
 
132
<a name="id3075603"></a><h3>Ref Counting Conventions</h3>
133
133
<p>And now for the important stuff:</p>
134
134
<div class="refsect3" lang="en">
135
 
<a name="id2592893"></a><h4>Bonobo Ref Counting</h4>
 
135
<a name="id3075612"></a><h4>Bonobo Ref Counting</h4>
136
136
<p>The Bonobo ref count convention is as follows.
137
137
                    (Mild rewording; same meaning as before)</p>
138
138
<div class="orderedlist"><ol type="1">
162
162
                    side-effects.</p>
163
163
</div>
164
164
<div class="refsect3" lang="en">
165
 
<a name="id2592944"></a><h4>CORBA Ref-counting</h4>
 
165
<a name="id3075663"></a><h4>CORBA Ref-counting</h4>
166
166
<p>Since the ORB also maintains reference counts
167
167
                    per interface handle, should you be returning a
168
168
                    reference to an object it is imperative to</p>
206
206
</div>
207
207
</div>
208
208
<div class="refsect3" lang="en">
209
 
<a name="id2593028"></a><h4>Ref counting and one-way methods</h4>
 
209
<a name="id3075748"></a><h4>Ref counting and one-way methods</h4>
210
210
<p>While the ORB has built in support for correct
211
211
                    referencing on 1 way methods, the Bonobo reference
212
212
                    count does not; hence if you wish to hand a bonobo