RE: [orbit] C++ Mapping



My server kept crashing, so I had to make the following changes 
in orbit-object.c and poa.c:

--- ORBit2-2.9.7/src/orb/orb-core/orbit-object.c	2003-10-29 06:00:54.000000000 -0800
+++ orbit-object.c	2004-02-19 16:08:55.000000000 -0800
@@ -146,10 +146,13 @@
 static void
 do_unref (ORBit_RootObject robj)
 {
-	g_assert (robj->refs < ORBIT_REFCOUNT_MAX && robj->refs > 0);
+    if (robj->refs == 0)
+        return;
 
-	robj->refs--;
-	total_refs--;
+    g_assert (robj->refs < ORBIT_REFCOUNT_MAX && robj->refs > 0);
+
+    robj->refs--;
+    total_refs--;
 
 	if (robj->refs == 0) {
 		if (!ORBit_RootObject_lifecycle_lock) /* No locking */
--- ORBit2-2.9.7/src/orb/poa/poa.c	2004-01-14 06:51:47.000000000 -0800
+++ poa.c	2004-02-19 16:08:55.000000000 -0800
@@ -1757,8 +1757,8 @@
 	CORBA_char *str;
 
 	poa_sys_exception_val_if_fail (id != NULL, ex_CORBA_BAD_PARAM, NULL);
-	poa_sys_exception_val_if_fail (memchr (id->_buffer, '\0', id->_length),
-				       ex_CORBA_BAD_PARAM, NULL);
+	// poa_sys_exception_val_if_fail (memchr (id->_buffer, '\0', id->_length),
+	// 			       ex_CORBA_BAD_PARAM, NULL);
 
 	str = CORBA_string_alloc (id->_length + 1);
 	memcpy (str, id->_buffer, id->_length);
@@ -2194,7 +2194,8 @@
 					     CORBA_Environment             *ev)
 {
 	CORBA_Object obj;
-	ORBit_POAObject	pobj, newobj;
+	ORBit_POAObject	pobj;
+    char newobj = 0;
 
 	poa_sys_exception_val_if_fail (poa != NULL, ex_CORBA_INV_OBJREF, NULL);
 	poa_sys_exception_val_if_fail (oid != NULL, ex_CORBA_BAD_PARAM, NULL);
@@ -2203,9 +2204,10 @@
 
 	pobj = ORBit_POA_object_id_lookup_T (poa, oid);
 	if (!pobj)
-		newobj = ORBit_POA_create_object_T (poa, oid, ev);
-	else
-		newobj = CORBA_OBJECT_NIL;
+    {
+        newobj = 1;
+		pobj = ORBit_POA_create_object_T (poa, oid, ev);
+    }
 
 	obj = ORBit_POA_obj_to_ref (poa, pobj, intf, ev);
 
I might give orbit2-2.10.1 a try when I have time.

Bo.


-----Original Message-----
From: Michael Meeks [mailto:michael ximian com]
Sent: Friday, May 14, 2004 3:55 AM
To: Bo Li
Cc: mlunzena uni-osnabrueck de; orbit-list gnome org
Subject: RE: [orbit] C++ Mapping


Hi Bo,

On Thu, 2004-05-13 at 18:54 -0700, Bo Li wrote:
> Other than that, except some problems in poa.c and 
> orbit-object.c, things are working quite well. In fact, by
> using C, it significantly reduced my server footprint.

	What problems in poa.c / orbit-object.c ?

> I was using ORBit-2.9.7 and orbitcpp-1.3.8. 

	You might want to udpate to ORBit2-2.10.1 :-)

	Regards,

		Michael.

-- 
 michael ximian com  <><, Pseudo Engineer, itinerant idiot





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