Re: ORBIT-WARNING **: No POA found for operation



Hi Yves,

On Fri, 2002-06-28 at 15:14, Yves De Muyter wrote:
> I have distilled a small part to demonstrate my problem. It can be found on:

	I pulled that, built it [ isn't pkg-config great ], and you have the
following misunderstanding:

        gtk_signal_connect (GTK_WIDGET(button), "clicked",
			    clicked_handler,
-			    call_when_clicked);
+			    CORBA_Object_duplicate (call_when_clicked,
+						    ev));

	The lifetime of an object handle - especially one passed to a skel is
only that of the method. Thus when the method exits, 'call_when_clicked'
is freed - and you go on to invoke a method on it - which results in
accessing the freed memory which you kept a pointer to.

	Thus you need to reference it - _really_ you need to de-reference it as
well when you dis-connect the signal / finalize the object. In reality
it's better not to use a signal handler closure to do do this ref
counting with.

> Also, i'm not sure if i need to call gtk_main for the orb to run in orbit2.
> Am i right to think orbit2 uses g_main_loop like gtk does ?

	Yes - either use the glib mainloop, or use linc_main_loop see linc.h;
ultimately if you want Gtk+ apps to work you need to do a gtk_init /
gtk_main, but for the server you can do other things.

	Also - it's rather a curious design to start the 'server' with the
client's IOR ;-)

	HTH,

		Michael.

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




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