Moving files to packaging and extracing new tarball.
[profile/ivi/glib2.git] / docs / reference / gobject / html / tools-refdb.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Debugging reference count problems</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GObject Reference Manual">
8 <link rel="up" href="pt03.html" title="Part V. Related Tools">
9 <link rel="prev" href="tools-ginspector.html" title="Graphical inspection of GObjects">
10 <link rel="next" href="tools-gtkdoc.html" title="Writing API docs">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
16 <td><a accesskey="p" href="tools-ginspector.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
17 <td><a accesskey="u" href="pt03.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
18 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
19 <th width="100%" align="center">GObject Reference Manual</th>
20 <td><a accesskey="n" href="tools-gtkdoc.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
21 </tr></table>
22 <div class="chapter">
23 <div class="titlepage"><div><div><h2 class="title">
24 <a name="tools-refdb"></a>Debugging reference count problems</h2></div></div></div>
25 <p>
26       The reference counting scheme used by GObject does solve quite 
27       a few memory management problems but also introduces new sources of bugs.
28       In large applications, finding the exact spot where the reference count
29       of an Object is not properly handled can be very difficult. Hopefully, 
30       there exist a tool named <a class="ulink" href="http://refdbg.sf.net/" target="_top">refdbg</a>
31       which can be used to automate the task of tracking down the location
32       of invalid code with regard to reference counting. This application 
33       intercepts the reference counting calls and tries to detect invalid behavior. 
34       It supports a filter-rule mechanism to let you trace only the objects you are 
35       interested in and it can be used together with GDB.
36     </p>
37 <p>
38       
39       Note that if GObject has been compiled with <code class="option">--enable-debug=yes</code>,
40       it exports a trap variable 
41       </p>
42 <pre class="programlisting">
43 static volatile GObject *g_trap_object_ref;
44       </pre>
45 <p>
46       If set to a non-NULL value, <a class="link" href="gobject-The-Base-Object-Type.html#g-object-ref" title="g_object_ref ()">g_object_ref</a>()
47       and <a class="link" href="gobject-The-Base-Object-Type.html#g-object-unref" title="g_object_unref ()">g_object_unref</a>() will be intercepted
48       when called with that value. 
49     </p>
50 </div>
51 <div class="footer">
52 <hr>
53           Generated by GTK-Doc V1.18</div>
54 </body>
55 </html>