aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-08-21 01:39:37 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-08-21 01:39:37 +0800
commitc37df166047a8f213e45ef152c510702b1908d24 (patch)
treea3e2bcaf2148db4ca0ad74e8eae429deb23bed4f /camel/providers/imap
parent572cd35fe386340e6089721c36711d502db6889c (diff)
downloadgsoc2013-evolution-c37df166047a8f213e45ef152c510702b1908d24.tar.gz
gsoc2013-evolution-c37df166047a8f213e45ef152c510702b1908d24.tar.zst
gsoc2013-evolution-c37df166047a8f213e45ef152c510702b1908d24.zip
Make sure to ref the stream. Fixes bug #47749.
2003-08-20 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-wrapper.c (imap_wrapper_hydrate): Make sure to ref the stream. Fixes bug #47749. svn path=/trunk/; revision=22315
Diffstat (limited to 'camel/providers/imap')
-rw-r--r--camel/providers/imap/camel-imap-wrapper.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/camel/providers/imap/camel-imap-wrapper.c b/camel/providers/imap/camel-imap-wrapper.c
index cdba687843..f2f87d5409 100644
--- a/camel/providers/imap/camel-imap-wrapper.c
+++ b/camel/providers/imap/camel-imap-wrapper.c
@@ -89,11 +89,12 @@ camel_imap_wrapper_init (gpointer object, gpointer klass)
CamelType
camel_imap_wrapper_get_type (void)
{
- static CamelType camel_imap_wrapper_type = CAMEL_INVALID_TYPE;
+ static CamelType type = CAMEL_INVALID_TYPE;
- if (camel_imap_wrapper_type == CAMEL_INVALID_TYPE) {
- camel_imap_wrapper_type = camel_type_register (
- CAMEL_DATA_WRAPPER_TYPE, "CamelImapWrapper",
+ if (type == CAMEL_INVALID_TYPE) {
+ type = camel_type_register (
+ CAMEL_DATA_WRAPPER_TYPE,
+ "CamelImapWrapper",
sizeof (CamelImapWrapper),
sizeof (CamelImapWrapperClass),
(CamelObjectClassInitFunc) camel_imap_wrapper_class_init,
@@ -102,7 +103,7 @@ camel_imap_wrapper_get_type (void)
(CamelObjectFinalizeFunc) camel_imap_wrapper_finalize);
}
- return camel_imap_wrapper_type;
+ return type;
}
@@ -111,6 +112,7 @@ imap_wrapper_hydrate (CamelImapWrapper *imap_wrapper, CamelStream *stream)
{
CamelDataWrapper *data_wrapper = (CamelDataWrapper *) imap_wrapper;
+ camel_object_ref (stream);
data_wrapper->stream = stream;
data_wrapper->offline = FALSE;
@@ -123,7 +125,7 @@ imap_wrapper_hydrate (CamelImapWrapper *imap_wrapper, CamelStream *stream)
}
-static int
+static ssize_t
write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
{
CamelImapWrapper *imap_wrapper = CAMEL_IMAP_WRAPPER (data_wrapper);
@@ -142,7 +144,7 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
}
imap_wrapper_hydrate (imap_wrapper, datastream);
- camel_object_unref (CAMEL_OBJECT (datastream));
+ camel_object_unref (datastream);
}
CAMEL_IMAP_WRAPPER_UNLOCK (imap_wrapper, lock);