avoid CORBA allocations by using the CORBA_any directly. Free the CORBA
authorRodrigo Moya <rodrigo@ximian.com>
Mon, 12 Jan 2004 16:56:25 +0000 (16:56 +0000)
committerRodrigo Moya <rodrigo@src.gnome.org>
Mon, 12 Jan 2004 16:56:25 +0000 (16:56 +0000)
2004-01-12  Rodrigo Moya <rodrigo@ximian.com>

* src/server-logging.c (server_log_handler): avoid CORBA allocations
by using the CORBA_any directly. Free the CORBA exception.

ChangeLog
src/server-logging.c

index 765ac8d..7e198dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-12  Rodrigo Moya <rodrigo@ximian.com>
+
+       * src/server-logging.c (server_log_handler): avoid CORBA allocations
+       by using the CORBA_any directly. Free the CORBA exception.
+
 2004-01-10  Rodrigo Moya <rodrigo@ximian.com>
 
        * libedataserver/e-file-cache.c (e_file_cache_set_property): fixed
index 5fd3cdc..409295b 100644 (file)
@@ -66,7 +66,7 @@ server_log_handler(const gchar *domain,
        ServerLogging *logging = SERVER_LOGGING (user_data);
        BonoboEventSource *es = BONOBO_EVENT_SOURCE (logging);
        CORBA_Environment ev;
-       CORBA_any *value;
+       CORBA_any value;
        GNOME_Evolution_DataServer_Logging_LogEvent log_event;
 
        printf ("in server_log_handler\n");
@@ -84,26 +84,18 @@ server_log_handler(const gchar *domain,
        else if ((flags & G_LOG_LEVEL_DEBUG) == G_LOG_LEVEL_DEBUG)
                log_event.level = GNOME_Evolution_DataServer_Logging_Debug;
 
-       log_event.domain = CORBA_string_dup (domain);
-       log_event.message = CORBA_string_dup (msg);
+       log_event.domain = (CORBA_char *) domain;
+       log_event.message = (CORBA_char *) msg;
 
-       CORBA_exception_init (&ev);
-
-       value = bonobo_arg_new (TC_GNOME_Evolution_DataServer_Logging_LogEvent);
-
-       BONOBO_ARG_SET_GENERAL (value, log_event,
-                               TC_GNOME_Evolution_DataServer_Logging_LogEvent,
-                               GNOME_Evolution_DataServer_Logging_LogEvent,
-                               NULL);
+       value._type = TC_GNOME_Evolution_DataServer_Logging_LogEvent;
+       value._value = &log_event;
 
        if (bonobo_event_source_has_listener (es, "log_event")) {
-
-               bonobo_event_source_notify_listeners (es, "log_event", value, &ev); 
+               CORBA_exception_init (&ev);
+               bonobo_event_source_notify_listeners (es, "log_event", &value, &ev); 
+               CORBA_exception_free (&ev);
        }
 
-       CORBA_free (log_event.domain);
-       CORBA_free (log_event.message);
-
        g_log_default_handler (domain, flags, msg, NULL);
 }