aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/providers/imap/camel-imap-wrapper.c16
2 files changed, 14 insertions, 7 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 8517c00feb..20904fac03 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
2003-08-18 Not Zed <NotZed@Ximian.com>
* camel-http-stream.c: Various fixes to make it work.
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);