GLib-Binding; dbus_new/dbus_free

Franz Reitinger reitinger.franz at utanet.at
Thu Aug 9 02:47:43 PDT 2007


Hi!

I'm using the GLib-binding of dbus and have already specified several
interfaces with several out-params. All these out-params are responsible
for fetching data from dbus-service to client.
Currently I'm using dbus_new on the server-side and dbus_free on the
client-side for allocating/freeing the memory.

Server-Side:

gboolean textServer_GetText(DBusGProxy *proxy, const guchar IN_category,
		const guchar IN_txtId, char ** OUT_txt, GError **error) {
               .....
                *out = dbus_new(char,LEN);
               .....

}

Client-Side:

...
char *textB=NULL;

call
      if (!at_eta_TextServer_text_server__get_text (proxy, cat, id,       
    &textB, &error) ) {

 .....
}

dbus_free(textB);


Is this the correct way or are there other methods for memory management?

ThanX
/franzR

btw.:
The docu tells, that these functions should only be used internally by dbus.




More information about the dbus mailing list