After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 654785 - Pango bindings - generated code contains errors
Pango bindings - generated code contains errors
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings
0.12.x
Other All
: Normal minor
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-07-17 14:51 UTC by Jerry Casiano
Modified: 2011-07-17 21:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jerry Casiano 2011-07-17 14:51:06 UTC
Using something like

Pango.Language.from_string("xx").get_sample_string();

results in "undefined reference to `pango_language_free'" during compilation.


There is no pango_language_free function. The Pango docs say it should not be freed.


Workaround

Language * lang = Language.from_string("xx");
return lang->get_sample_string();
Comment 1 Luca Bruno 2011-07-17 17:25:17 UTC
commit dded891b0650179092058258dbee94e54379ddd1
Author: Luca Bruno <lucabru@src.gnome.org>
Date:   Sun Jul 17 19:20:46 2011 +0200

    pango: Mark return value of Language.from_string to be unowned
    
    Fixes regression introduced by commit 5d6c21cebd3c5a.
    
    Fixes bug 654785.

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 2 Jerry Casiano 2011-07-17 21:25:05 UTC
In my local vapi I also had to change

public static unowned Pango.Language? from_string (string language);

to

public static unowned Pango.Language from_string (string language);

for it to compile without errors.

The metadata file also has "nullable=1"


Thanks again.
Comment 3 Luca Bruno 2011-07-17 21:32:33 UTC
(In reply to comment #2)
> In my local vapi I also had to change
> 
> public static unowned Pango.Language? from_string (string language);
> 
> to
> 
> public static unowned Pango.Language from_string (string language);
> 
> for it to compile without errors.

I don't know what errors you're talking about (maybe warnings), but nullable is correct.
Comment 4 Jerry Casiano 2011-07-17 21:33:28 UTC
Nevermind, this still doesn't work properly for me. I was still using the workaround function and didn't realize it. I get the same error as before with either changes.

Sorry for the noise.