Re: exception on exit



On Fri, 2005-07-08 at 09:41 +0200, Alexander Larsson wrote:

> > How can you tell if the process providing your widget has died. One of
> > the libraries that this process is calling likes to make lots of
> > uncatchable abort calls when it has errors. Now, I don't feel like
> > hacking Fortran, so I'd much rather just find out when that process has
> > died, cleanup the mess and ask if they want to restart it. Is there a
> > signal I can listen to for this?
> 
> Not in bonobo, but there is one in ORBit. The (non-standard) corba call
> ORBit_small_listen_for_broken gives you a callback when the lowlevel tcp
> connection used for corba requests to that object is broken.

Hmm, I'm a little confused. Previous discussion I've found on the topic
says this call is for clients of the server object (I think this is what
Bonobo calls a factory) to find out when their connection to the server
has died (ie. the factory has crashed).

You need to pass it a CORBA_Object, so I would guess something like:
  CORBA_Object ref = BONOBO_OBJREF(server);

However, it's not clear to me what 'server' is in this case.
The code looks something like this:

    container = bonobo_window_get_ui_container (BONOBO_WINDOW (window));
    component = bonobo_ui_component_new ("mgiva-container");
    bonobo_ui_component_set_container (component, BONOBO_OBJREF (container),
                    NULL);

    mgivaMap = bonobo_widget_new_control ("OAFIID:mgivaMap",
                    BONOBO_OBJREF (container));

    if (!BONOBO_WIDGET (mgivaMap))
    {
            gtk_widget_destroy (window);
            mgiva_error (NULL, "Couldn't start mgiva-map", NULL);
            return FALSE;
    }

    ORBit_small_listen_for_broken (BONOBO_OBJREF (??WHAT GOES HERE??),
                    G_CALLBACK (lost_mbc_component_cb),
                    NULL);

Failing that, what contains good example code that I might want to look
at?

Thanks,
--d




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