From: Not Zed Date: Mon, 2 Aug 2004 11:38:08 +0000 (+0000) Subject: ** See bug #58642. X-Git-Tag: upstream/3.7.4~8521 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9f5f687ce455f84100fd9a0c8a0a3314dd222b98;p=platform%2Fupstream%2Fevolution-data-server.git ** See bug #58642. 2004-08-02 Not Zed ** See bug #58642. * libedata-cal/e-data-cal-factory.c (backend_last_client_gone_cb): the table key includes the kidn for some reason. (impl_CalFactory_getCal): store the icalkind in the uri, not the calobjtype. Fix a memory leak. --- diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 3f105d0..4c31b6d 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,12 @@ +2004-08-02 Not Zed + + ** See bug #58642. + + * libedata-cal/e-data-cal-factory.c (backend_last_client_gone_cb): + the table key includes the kidn for some reason. + (impl_CalFactory_getCal): store the icalkind in the uri, not the + calobjtype. Fix a memory leak. + 2004-08-02 Chenthill Palanisamy Fixes #57127 diff --git a/calendar/libedata-cal/e-data-cal-factory.c b/calendar/libedata-cal/e-data-cal-factory.c index 0b68bf4..0812479 100644 --- a/calendar/libedata-cal/e-data-cal-factory.c +++ b/calendar/libedata-cal/e-data-cal-factory.c @@ -58,6 +58,7 @@ enum SIGNALS { static guint signals[LAST_SIGNAL]; /* Opening calendars */ + static icalcomponent_kind calobjtype_to_icalkind (const GNOME_Evolution_Calendar_CalObjType type) { @@ -122,6 +123,7 @@ backend_last_client_gone_cb (ECalBackend *backend, gpointer data) EDataCalFactoryPrivate *priv; ECalBackend *ret_backend; const char *uristr; + char *uri; fprintf (stderr, "backend_last_client_gone_cb() called!\n"); @@ -132,18 +134,19 @@ backend_last_client_gone_cb (ECalBackend *backend, gpointer data) uristr = e_cal_backend_get_uri (backend); g_assert (uristr != NULL); + uri = g_strdup_printf("%s:%d", uristr, (int)e_cal_backend_get_kind(backend)); - ret_backend = lookup_backend (factory, uristr); + ret_backend = lookup_backend (factory, uri); g_assert (ret_backend != NULL); g_assert (ret_backend == backend); - g_hash_table_remove (priv->backends, uristr); + g_hash_table_remove (priv->backends, uri); + g_free(uri); g_signal_handlers_disconnect_matched (backend, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, data); /* Notify upstream if there are no more backends */ - if (g_hash_table_size (priv->backends) == 0) g_signal_emit (G_OBJECT (factory), signals[LAST_CALENDAR_GONE], 0); } @@ -197,7 +200,9 @@ impl_CalFactory_getCal (PortableServer_Servant servant, return CORBA_OBJECT_NIL; } - uri_type_string = g_strdup_printf ("%s:%d", e_uri_to_string (uri, FALSE), type); + str_uri = e_uri_to_string(uri, FALSE); + uri_type_string = g_strdup_printf ("%s:%d", str_uri, (int)calobjtype_to_icalkind (type)); + g_free(str_uri); /* Find the associated backend type (if any) */ backend_type = get_backend_type (priv->methods, uri->protocol, calobjtype_to_icalkind (type));