diamondburned / gotk4

Autogenerated GTK4 bindings for Go
GNU Affero General Public License v3.0
492 stars 19 forks source link

Isolate freeing code from generation code #23

Open diamondburned opened 3 years ago

diamondburned commented 3 years ago

C to Go and Go to C conversion routines should be refactored to have the code used to generate freeing statements moved outside into another function. Preferably, the function calling part should be moved out, while the generation code should still generate the right code to call those functions.

Having free functions separately will help implementing HashTable (#20) properly, as that will allow the HashTable to free values easily. It will also help once map[T]T is turned into a no-copy container type instead, preferably once generics is available.

diamondburned commented 3 years ago

Having struct setters now depends on this issue as well for proper freeing of old fields.