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 589795 - Support for free functions which take a pointer to a pointer
Support for free functions which take a pointer to a pointer
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
0.7.x
Other All
: Normal minor
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-26 20:11 UTC by Evan Nemerson
Modified: 2009-08-01 15:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Create a free_function_address_of CCode attribute. (3.21 KB, patch)
2009-07-26 20:12 UTC, Evan Nemerson
committed Details | Review

Description Evan Nemerson 2009-07-26 20:11:15 UTC
Some libraries use a free function of the form

void foo_free (Foo ** foo)

instead of the much more common

void foo_free (Foo * foo)

The logic seems to be that they can set the pointer to null in the free function.

libftdi uses this convention, though they added wrappers specifically for the vala bindings in their API. libdmtx also uses this convention, and I could ask them to add wrappers to their API, but seeing as how this is the second library like this that I've come across, it might be common enough that it would be worth supporting in vala.
Comment 1 Evan Nemerson 2009-07-26 20:12:31 UTC
Created attachment 139246 [details] [review]
Create a free_function_address_of CCode attribute.
Comment 2 Jürg Billeter 2009-08-01 15:47:45 UTC
commit fbee40cdf5483c5747e80f6661aeeda15d1725d4
Author: Evan Nemerson <evan@polussystems.com>
Date:   Sat Aug 1 17:44:45 2009 +0200

    Support [CCode (free_function_address_of = true)] attribute
    
    Fixes bug 589795.