Re: Querying oaf of the interfaces a component implements ?



Elliot Lee wrote:

> On Thu, 19 Oct 2000 rodrigo linuxave net wrote:
>
> > ok, here's how I've done it. As I don't understand very well the race condition you
> > talk about, please tell me if what I'm trying would have any consequence:
>
> The race condition is that the _active status can change in between when
> you retrieve it and when you activate.
>
> > First, I've got this function:
> >
> > gboolean
> > gda_corba_oafiid_is_active (const gchar *oafiid)
> > {
> >   OAF_ServerInfoList* servlist;
> >   CORBA_Environment   ev;
> >   gchar*              query;
> >
> >   g_return_val_if_fail(oafiid != NULL, FALSE);
> >
> >   query = g_strdup_printf("iid = '%s' AND _active = true", oafiid);
> >   CORBA_exception_init(&ev);
> >   servlist = oaf_query(query, NULL, &ev);
> >   CORBA_exception_free(&ev);
> >   g_free((gpointer) query);
> >
> >   if (servlist)
>
> This is broken - the pointer will not be null unless possible an exception
> is raised. You need to check ev for an error, and servlist will not be
> NULL if zero results are returned (servlist->_length will be zero).
>
>

yes, sorry, I wrote it too quickly.  Thanks for the help!






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]