Rename camel_session_get_service().
authorMatthew Barnes <mbarnes@redhat.com>
Sun, 12 Aug 2012 14:12:38 +0000 (10:12 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Sun, 12 Aug 2012 14:12:38 +0000 (10:12 -0400)
commit123d96aa7703054bcbc51e911d73db7190428d35
tree4c152d1e5012ad10644830f9e9559140f346f8e3
parentf5ae84279d39752897df0f3213e34165d50e582d
Rename camel_session_get_service().

Applying lessons learned from ESourceRegistry.

Rename camel_session_get_service() to camel_session_ref_service()
and have it return a new reference.

When returning a pointer to a reference-counted object in a multi-
threaded environment, always increase the object's reference count
before returning so as to transfer a new reference to the caller.

Otherwise it introduces a potential race where the reference-counted
object may lose its last reference and be freed while the caller is
still using the object.  Even if the caller immediately increments
the object's reference count, it's still a potential race.

Transferring a new reference to the caller means the caller must
unreference the object when finished with it so the object will be
properly freed when it's no longer needed.

Similarly for camel_session_get_service_by_url().
camel/camel-filter-search.c
camel/camel-sasl-popb4smtp.c
camel/camel-session.c
camel/camel-session.h
docs/reference/camel/camel-sections.txt