<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:919752879;
        mso-list-type:hybrid;
        mso-list-template-ids:694193274 67698699 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0D8;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="Section1">
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">Hi.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">We are using the following APIs to create a DBUS signal and send the DBUS signal. But we see that there is a memory leak every time a new dbus signal is created
 and sent. So in our application the memory utilization progressively increases and the application crashed after sometime due to lack of memory.<o:p></o:p></span></font></p>
<p class="MsoNormal" style="margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo1">
<![if !supportLists]><font size="2" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings"><span style="mso-list:Ignore">&Oslash;<font size="1" face="Times New Roman"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span></span></font><![endif]><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">Are we missing some step here to free memory?<o:p></o:p></span></font></p>
<p class="MsoNormal" style="margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo1">
<![if !supportLists]><font size="2" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings"><span style="mso-list:Ignore">&Oslash;<font size="1" face="Times New Roman"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span></span></font><![endif]><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">&nbsp;Is there any other API which should be called which frees the memory once a signal has been sent?<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">Thanks,<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">Priya<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;
<font color="blue"><span style="color:blue">DBusMessage *msg;<o:p></o:p></span></font></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp; DBusMessageIter args;<o:p></o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp; /* create a signal &amp; check for errors */<o:p></o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp; msg = dbus_message_new_signal(ObjectName, // object name of the signal<o:p></o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InterfaceName, // interface name of the signal<o:p></o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageName); // name of the signal<o:p></o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp; if (NULL == msg)
<o:p></o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp; {
<o:p></o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fprintf(stderr, &quot;Message Null\n&quot;);
<o:p></o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp; dbus_message_iter_init(msg, &amp;args);&nbsp;
<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;color:blue"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp; // send the message and flush the connection<o:p></o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp; if (!dbus_connection_send(conn, msg, &amp;serial))
<o:p></o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fprintf(stderr, &quot;Out Of Memory!\n&quot;);<o:p></o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit(1);<o:p></o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:blue">&nbsp;&nbsp;&nbsp; dbus_connection_flush(conn);<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="1" color="blue" face="Courier New"><span style="font-size:9.0pt;font-family:&quot;Courier New&quot;;color:blue">&nbsp;&nbsp;&nbsp; dbus_message_unref(msg);</span></font><font size="2" color="blue" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:blue"><o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="blue" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:blue"><o:p>&nbsp;</o:p></span></font></p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1">http://www.mindtree.com/email/disclaimer.html<br>
</font>
</body>
</html>