<HTML><HEAD>
<META http-equiv=Content-Type content='text/html; charset=windows-1252'>
<title>Samsung Enterprise Portal mySingle</title>
<style> P, td, li {font-family:Arial, arial; font-size:9pt; margin-top:5px;margin-bottom:5px;} body{font-family:Arial, arial; font-size:9pt;}</style>
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:"Malgun Gothic";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
        {font-family:"Malgun Gothic";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        text-autospace:none;
        word-break:break-hangul;
        font-size:10.0pt;
        font-family:"Malgun Gothic";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Malgun Gothic";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
/* Page Definitions */
@page Section1
        {size:612.0pt 792.0pt;
        margin:3.0cm 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
</HEAD><BODY>I resend my message to the list in order to be immediately accepted.
<p>Thank you.</p>
<p> <br>------- <b>Original Message</b> -------<br><b>Sender</b> : ???<deokjin81.kim@samsung.com> E3(??)/??/N-Project T/F(??)/????<br><b>Date</b> : 2009-06-22 14:24 (GMT+09:00)<br><b>Title</b> : _get_image_surface() function has memory leak<br><br><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<x-BODY lang=KO link=blue vlink=purple>
</p><div class=Section1>
<p class=MsoNormal><span lang=EN-US>Hello.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>I have a question about cairo source code.
(_get_image_surface function in cairo-xlib-surface.c file)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>_get_image_surface ()<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>{<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> Cairo_image_surface_t
*image = NULL;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> XImage
*ximage;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> …<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> ximage
= XGetImage (…);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> image
= _cairo_image_surface_create_with_pixman_format ((unsigned char *)
ximage->data, …)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> _cairo_image_surface_assume_ownership_of_data
(image);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'> ximage->data
= NULL;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> …<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>}<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>In above code, ximage->data= NULL prevents
libX11.so.6 from freeing ximage->data.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>How can I free allocated memory by ximage?<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Thank you in advance.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Regards,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Deok-Jin Kim<o:p></o:p></span></p>
</div>
</x-BODY>
<p> </p><p> </p><!--SP:deokjin81.kim--><!--deokjin81.kim:EP--><p> </p><p> </p></BODY></HTML>