Re: A (not so) little issue at gladeui/glade-project.c:1492

Juan Manuel Mouriz <[email protected]> Fri, 20 Feb 2015 22:03:45 -0300
Newsgroups gmane.comp.gnome.glade.devel
Message-ID <CAO9+-7k6A5pqmZ7s=tLqM2Rf2jGo5teiRAnwwm4=4+u8+aFe2g@mail.gmail.com>
--===============1132115198==
Content-Type: multipart/alternative; boundary=001a11c2b050e9da12050f8ebe75

--001a11c2b050e9da12050f8ebe75
Content-Type: text/plain; charset=UTF-8

Thanks Johannes,

I'm sorry, I made the mistake of watching a previous version and I see that the
code it's ok in GIT.

Thank you very much for pointing the correct way to free.

2015-02-20 4:32 GMT-03:00 Johannes Schmid <[email protected]>:

> Hi Juan!
>
> > In gladeui/glade-project.c:1492, the call to g_free (required_lib) not
> > always leave required_lib in NULL, at least for me, so the condition !
> > required_lib fail in the remaining bucles. Of cource, this occurs when
> > I use more than one requires-tag and can't use my own plugins.
>
> I don't fully see your point. required_lib is free'd in the last else
> branch and when the loop continues, the first thing is to initialize it
> to NULL
> (https://git.gnome.org/browse/glade/tree/gladeui/glade-project.c#n1443).
> So it shouldn't be a problem that it isn't being set to NULL.
>
> Sidenote: The correct way to free it and set it to NULL would be
> g_clear_pointer (&required_lib, g_free) but that shouldn't be necessary
> here.
>
>
> Regards,
> Johannes
>
>

--001a11c2b050e9da12050f8ebe75
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thanks Johannes,<br><div class=3D"gmail_extra"><br><span i=
d=3D"result_box" class=3D"" lang=3D"en"><span class=3D"">I&#39;m sorry</spa=
n><span>,</span> <span class=3D"">I made the mistake</span> <span class=3D"=
">of watching a</span> <span class=3D"">previous</span> <span class=3D"">ve=
rsion</span></span> <span tabindex=3D"-1" id=3D"result_box" class=3D"" lang=
=3D"en"><span class=3D"">and I see</span> <span class=3D"">that</span> <spa=
n class=3D"">the code</span> it&#39;s ok<span class=3D""> in</span> <span c=
lass=3D"">GIT</span></span>.<br><br>Thank you very much for pointing the co=
rrect way to free.<br><br><div class=3D"gmail_quote">2015-02-20 4:32 GMT-03=
:00 Johannes Schmid <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]=
" target=3D"_blank">[email protected]</a>&gt;</span>:<br><blockquote class=3D=
"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(2=
04,204,204);padding-left:1ex">Hi Juan!<br>
<span class=3D""><br>
&gt; In gladeui/glade-project.c:1492, the call to g_free (required_lib) not=
<br>
&gt; always leave required_lib in NULL, at least for me, so the condition !=
<br>
&gt; required_lib fail in the remaining bucles. Of cource, this occurs when=
<br>
&gt; I use more than one requires-tag and can&#39;t use my own plugins.<br>
<br>
</span>I don&#39;t fully see your point. required_lib is free&#39;d in the =
last else<br>
branch and when the loop continues, the first thing is to initialize it<br>
to NULL<br>
(<a href=3D"https://git.gnome.org/browse/glade/tree/gladeui/glade-project.c=
#n1443" target=3D"_blank">https://git.gnome.org/browse/glade/tree/gladeui/g=
lade-project.c#n1443</a>).<br>
So it shouldn&#39;t be a problem that it isn&#39;t being set to NULL.<br>
<br>
Sidenote: The correct way to free it and set it to NULL would be<br>
g_clear_pointer (&amp;required_lib, g_free) but that shouldn&#39;t be neces=
sary<br>
here.<br>
<br>
<br>
Regards,<br>
Johannes<br>
<br>
</blockquote></div><br></div></div>

--001a11c2b050e9da12050f8ebe75--

--===============1132115198==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Glade-devel maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/glade-devel

--===============1132115198==--