bonobo_widget_new_subdoc error checking



bonobo_widget_new_subdoc doesn't check if it succesfully launched the
component or not, which causes lots of g_warnings before something
finally manages to clean up after it when it doesn't. This fixes it.

-- Dan

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/bonobo/ChangeLog,v
retrieving revision 1.361
diff -u -r1.361 ChangeLog
--- ChangeLog	2000/04/28 21:48:09	1.361
+++ ChangeLog	2000/04/29 16:59:10
@@ -1,3 +1,10 @@
+2000-04-29  Dan Winship  <danw@helixcode.com>
+
+	* bonobo/bonobo-widget.c (bonobo_widget_create_subdoc_object):
+	return right away if launching the component fails.
+	(bonobo_widget_new_subdoc): Check for the right error after
+	calling create_subdoc_object.
+
 2000-04-28  Darin Adler  <darin@eazel.com>
 
 	* bonobo/bonobo-uih-menu.c (menu_toplevel_create_widgets):
Index: bonobo/bonobo-widget.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-widget.c,v
retrieving revision 1.16
diff -u -r1.16 bonobo-widget.c
--- bonobo/bonobo-widget.c	2000/02/28 19:02:40	1.16
+++ bonobo/bonobo-widget.c	2000/04/29 16:59:11
@@ -205,14 +205,16 @@
 {
 	GtkWidget *view_widget;
 
+	bw->priv->server = bonobo_widget_launch_component (object_desc);
+	if (bw->priv->server == NULL)
+		return;
+
 	/*
 	 * Create the BonoboContainer.  This will contain
 	 * just one BonoboClientSite.
 	 */
 	bw->priv->container = bonobo_container_new ();
 
-	bw->priv->server = bonobo_widget_launch_component (object_desc);
-
 	/*
 	 * Create the client site.  This is the container-side point
 	 * of contact for the remote component.
@@ -260,7 +262,7 @@
 
 	bonobo_widget_create_subdoc_object (bw, object_desc, uih);
 
-	if (bw == NULL)
+	if (bw->priv->server == NULL)
 		return NULL;
  
 	bonobo_view_frame_set_covered (bw->priv->view_frame, FALSE);




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