Hi Naveen,<br><br>Thanks for you suggestion. But, gptr_all_dls is been assigned to *gptrAllDls before returning from the function. Hence, pointer to gptr_all_dls (which is stored in *gptrAllDls) doesn't go out of scope after this function call.<br>
<br>Also, I tested the changed code as per your suggestion, but still the crash is seen.<br><br><div class="gmail_quote">On Wed, Jul 29, 2009 at 4:47 PM, Naveen Verma <span dir="ltr"><<a href="mailto:ernaveenverma@gmail.com">ernaveenverma@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br>gboolean<br>downloadDaemonGetAllDownloads(DownloadDaemon* DaemonObject,<br>
GPtrArray** gptrAllDls,<br> GError** error)<br>{<br> GPtrArray* gptr_all_dls = g_ptr_array_sized_new(1);</blockquote></div><div>-- You should directly initialize *gptrAIIDIs here, then add the member in this, because the above gptr_all_dlls in stack and become out of scope after this function call.<br>
</div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br> gptr_all_dls->len = numDls;</blockquote></div><div>-- You don't need to set the length its dynamic array. <br>
</div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br> g_ptr_array_add(gptr_all_dls,(gpointer)(1234567));</blockquote>
</div><div>-- you can use GUINT_TO_POINTER(123456) <br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
<br> *gptrAllDls = gptr_all_dls;<br><br> return TRUE;<br>}<br></div>-Br</blockquote><div>Naveen<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>_______________________________________________<br>
dbus mailing list<br>
<a href="mailto:dbus@lists.freedesktop.org" target="_blank">dbus@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dbus" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dbus</a><br>
<br></blockquote></div><br>
</blockquote></div><br>