<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> </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">Ø<font size="1" face="Times New Roman"><span style="font:7.0pt "Times New Roman"">
</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">Ø<font size="1" face="Times New Roman"><span style="font:7.0pt "Times New Roman"">
</span></font></span></span></font><![endif]><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"> 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> </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> </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:"Courier New"">
<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:"Courier New";
color:blue"> 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:"Courier New";
color:blue"><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:"Courier New";
color:blue"> /* create a signal & 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:"Courier New";
color:blue"> 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:"Courier New";
color:blue"> 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:"Courier New";
color:blue"> 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:"Courier New";
color:blue"><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:"Courier New";
color:blue"> 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:"Courier New";
color:blue"> {
<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:"Courier New";
color:blue"> fprintf(stderr, "Message Null\n");
<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:"Courier New";
color:blue"> }<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:"Courier New";
color:blue"> dbus_message_iter_init(msg, &args);
<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:"Courier New";color:blue"><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:"Courier New";
color:blue"> // 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:"Courier New";
color:blue"> if (!dbus_connection_send(conn, msg, &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:"Courier New";
color:blue"> {<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:"Courier New";
color:blue"> fprintf(stderr, "Out Of Memory!\n");<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:"Courier New";
color:blue"> 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:"Courier New";
color:blue"> }<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:"Courier New";
color:blue"> 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:"Courier New";color:blue"> 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> </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>