Re: Keeping server in memory



Hi Gustavo,

On 14 Dec 2001, Gustavo Carneiro wrote:
>   I'm developing a program that activates a bonobo object. Recently,
> bonobo's behaviour has changed drastically:

        Right :-)

>   - Before, the app would activate the server using bonobo-activation
> and, when the app left, the server would still be running.

        Quite probably - this is typicaly extremely sub-optimal, since
it'll leave servers lying around on the system.

>   - Now (with a recent bonobo build) , when the app finishes the
> server also exits and, next time I run the client app, a new server is
> started.

        Good :-)

>   Is this behaviour intentional, or do I have a bug in my app? How I
> can I get the old behaviour back?

        Ok - so, you probably do want to quit your server after a while;
the trick is that the auto factory macros now do this for you:

        BonoboGenericFactory *factory;

        factory = bonobo_generic_factory_new (
                act_iid, factory_cb, user_data);

        if (factory) {
                bonobo_running_context_auto_exit_unref (
                        BONOBO_OBJECT (factory));

                bonobo_main ();

                return bonobo_debug_shutdown ();
        } else
                return 1;

        You just want to kill the 'auto_exit_unref' in this code - I would
strongly suggest that you do hook the 'all objects dead' condition and
perhaps timeout then before exiting - it's really bad news to leave stale
processes around.

>   PS: this is with gnome-2.0 platform.

        I'm really glad that you're hacking on gnome-2.0, more people
should;

        Regards,

		Michael.

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot




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