[Vala] Potential memory leak?



Hi. I have a question.

If you look at the documentation for the
gtk_source_completion_proposal_get_text () C function:
http://library.gnome.org/devel/gtksourceview/2.9/GtkSourceCompletionProposal.html#gtk-source-completion-proposal-get-text

It says "The returned string must be freed with g_free()". However,
this Vala code:

=====
string procedure = proposal.get_text();
=====

generates this C code:

=====
char* procedure;
[...]
procedure = g_strdup (gtk_source_completion_proposal_get_text (proposal));"
[...]
_g_free0 (procedure);
=====

Isn't this a memory leak? The original string returned from the
gtk_source_completion_proposal_get_text, which the documentation says
to free, is never freed.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]