string return result conventions

2008-09-14 Thread Luke Kenneth Casson Leighton
folks, hi, i'm looking for advice on memory return result conventions - who is responsible for maintaining andd/or freeing memory, in particular strings, as return results from pproperrty getting for example. the webkit-glib bindings are going extremely well, pywebkitgtk has them in use, however,

Re: string return result conventions

2008-09-14 Thread Havoc Pennington
Hi, On Sun, Sep 14, 2008 at 7:37 AM, Luke Kenneth Casson Leighton <[EMAIL PROTECTED]> wrote: > i'm looking for advice on memory return result conventions - who is > responsible for maintaining andd/or freeing memory, in particular > strings, as return results from pproperrty getting for example.

Re: string return result conventions

2008-09-14 Thread Tim Janik
On Sun, 14 Sep 2008, Luke Kenneth Casson Leighton wrote: folks, hi, i'm looking for advice on memory return result conventions - who is responsible for maintaining andd/or freeing memory, in particular strings, as return results from pproperrty getting for example. the webkit-glib bindings are

Re: string return result conventions

2008-09-15 Thread Luke Kenneth Casson Leighton
tim, thank you for responding. >> therefore it's important for me to find out what glib / gobject memory >> conventions are, for strings. > > Strings querried through the property interfacem e.g.: > > gchar *string = NULL; > g_object_get (label, "label", &string, NULL); > > is always duplicated an

Re: string return result conventions

2008-09-15 Thread Tim Janik
On Mon, 15 Sep 2008, Luke Kenneth Casson Leighton wrote: ok - in this situation, fortunately we have control over that. the property getter is entirely auto-generated. the code review of the new webkit glib/gobject bindings brought to light the webkit convention of not imposing any "memory fre

Re: string return result conventions

2008-09-15 Thread Christian Dywan
Am Mon, 15 Sep 2008 11:20:41 +0200 (CEST) schrieb Tim Janik <[EMAIL PROTECTED]>: > On Mon, 15 Sep 2008, Luke Kenneth Casson Leighton wrote: > > > clearly, the best overall thing would be to actually return the > > unicode strings themselves rather than convert them (needlessly?) to > > utf-8. >

Re: string return result conventions

2008-09-15 Thread Luke Kenneth Casson Leighton
>> it was recommended to me that i create a string pool system, to keep a >> record of strings created, and, at convenient times, destroy them all >> (reminds me of apache pools and samba talloc). exactly when is >> "convenient" is yet to be determined, which is the bit i'm not too >> keen on :) >

Re: string return result conventions

2008-09-15 Thread Owen Taylor
On Mon, 2008-09-15 at 08:59 +, Luke Kenneth Casson Leighton wrote: > tim, thank you for responding. > > >> therefore it's important for me to find out what glib / gobject memory > >> conventions are, for strings. > > > > Strings querried through the property interfacem e.g.: > > > > gchar *str

Re: string return result conventions

2008-09-15 Thread Luke Kenneth Casson Leighton
On Mon, Sep 15, 2008 at 3:48 PM, Owen Taylor <[EMAIL PROTECTED]> wrote: > On Mon, 2008-09-15 at 08:59 +, Luke Kenneth Casson Leighton wrote: >> tim, thank you for responding. >> >> >> therefore it's important for me to find out what glib / gobject memory >> >> conventions are, for strings. >> >

Re: string return result conventions

2008-09-15 Thread Luke Kenneth Casson Leighton
> ok - can i ask people a favour? could you kindly review e.g this: > http://lkcl.net/webkit/DerivedSources/GdomAttr.cpp > just looking at it myself, i think where i use fromUTF8 i have a > memory leak, ... but after looking at it again i don't think i have.. > there, but key question:

Re: string return result conventions

2008-09-16 Thread Tim Janik
On Mon, 15 Sep 2008, Luke Kenneth Casson Leighton wrote: ok - can i ask people a favour? could you kindly review e.g this: http://lkcl.net/webkit/DerivedSources/GdomAttr.cpp just looking at it myself, i think where i use fromUTF8 i have a memory leak, ... but after looking at it ag