On Tue, Mar 12, 2013 at 01:32:13PM +0100, Marc-André Lureau wrote:
> On Tue, Mar 12, 2013 at 12:23 PM, Christophe Fergeau
> <[email protected]> wrote:
> > void SpiceController::GetClientPaths(GStrv *client_argv, GStrv 
> > *fallback_argv)
> > +{
> > +    if (client_argv != NULL) {
> > +        *client_argv = g_new0(char *, 2);
> > +        (*client_argv)[0] = g_strdup("/usr/libexec/spice-xpi-client");
> > +    }
> > +
> > +    if (fallback_argv != NULL) {
> > +        *client_argv = g_new0(char *, 3);
> > +        (*client_argv)[0] = g_strdup("/usr/bin/spicec");
> > +        (*client_argv)[1] = g_strdup("--controller");
> > +    }
> > +}
> 
> any reason this needs to be allocated? I would rather see a static const 
> array.

Yup, the Windows version of this function will be using dynamic allocation
as we need to get the client name from the registry, split it, ...
see
http://cgit.freedesktop.org/~teuf/spice-xpi/tree/SpiceXPI/src/plugin/controller-win.cpp?h=mingw#n151

> Also, I don't see why it should be returned by the same function.

Good point, I can split it.

Christophe

Attachment: pgpxpzaSFVz23.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to