-rw-r--r-- | libical/src/libical/icalmemory.c | 2 | ||||
-rw-r--r-- | libkcal/icalformat.cpp | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/libical/src/libical/icalmemory.c b/libical/src/libical/icalmemory.c index 18d7ef9..3ed38ad 100644 --- a/libical/src/libical/icalmemory.c +++ b/libical/src/libical/icalmemory.c | |||
@@ -64,17 +64,17 @@ | |||
64 | #include <stdio.h> /* for printf (debugging) */ | 64 | #include <stdio.h> /* for printf (debugging) */ |
65 | #include <stdlib.h> /* for malloc, realloc */ | 65 | #include <stdlib.h> /* for malloc, realloc */ |
66 | #include <string.h> /* for memset(), strdup */ | 66 | #include <string.h> /* for memset(), strdup */ |
67 | 67 | ||
68 | #ifdef WIN32 | 68 | #ifdef WIN32 |
69 | #include <windows.h> | 69 | #include <windows.h> |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | #define BUFFER_RING_SIZE 50 | 72 | #define BUFFER_RING_SIZE 100 |
73 | #define MIN_BUFFER_SIZE 64 | 73 | #define MIN_BUFFER_SIZE 64 |
74 | 74 | ||
75 | 75 | ||
76 | /* HACK. Not threadsafe */ | 76 | /* HACK. Not threadsafe */ |
77 | 77 | ||
78 | typedef struct { | 78 | typedef struct { |
79 | int pos; | 79 | int pos; |
80 | void *ring[BUFFER_RING_SIZE]; | 80 | void *ring[BUFFER_RING_SIZE]; |
diff --git a/libkcal/icalformat.cpp b/libkcal/icalformat.cpp index d9fe40b..5877406 100644 --- a/libkcal/icalformat.cpp +++ b/libkcal/icalformat.cpp | |||
@@ -139,16 +139,17 @@ bool ICalFormat::fromString( Calendar *cal, const QString &text ) | |||
139 | setException(new ErrorFormat(ErrorFormat::ParseErrorKcal)); | 139 | setException(new ErrorFormat(ErrorFormat::ParseErrorKcal)); |
140 | } | 140 | } |
141 | success = false; | 141 | success = false; |
142 | } else | 142 | } else |
143 | mLoadedProductId = mImpl->loadedProductId(); | 143 | mLoadedProductId = mImpl->loadedProductId(); |
144 | } | 144 | } |
145 | 145 | ||
146 | icalcomponent_free( calendar ); | 146 | icalcomponent_free( calendar ); |
147 | icalmemory_free_ring(); | ||
147 | 148 | ||
148 | return success; | 149 | return success; |
149 | } | 150 | } |
150 | 151 | ||
151 | Incidence *ICalFormat::fromString( const QString &text ) | 152 | Incidence *ICalFormat::fromString( const QString &text ) |
152 | { | 153 | { |
153 | CalendarLocal cal( mTimeZoneId ); | 154 | CalendarLocal cal( mTimeZoneId ); |
154 | fromString(&cal, text); | 155 | fromString(&cal, text); |
@@ -220,19 +221,20 @@ QString ICalFormat::toString( Calendar *cal ) | |||
220 | if ( text ) { | 221 | if ( text ) { |
221 | ret = QString ( text ); | 222 | ret = QString ( text ); |
222 | } | 223 | } |
223 | icalcomponent_free( calendar ); | 224 | icalcomponent_free( calendar ); |
224 | 225 | ||
225 | if (!text) { | 226 | if (!text) { |
226 | setException(new ErrorFormat(ErrorFormat::SaveError, | 227 | setException(new ErrorFormat(ErrorFormat::SaveError, |
227 | i18n("libical error"))); | 228 | i18n("libical error"))); |
229 | icalmemory_free_ring(); | ||
228 | return QString::null; | 230 | return QString::null; |
229 | } | 231 | } |
230 | 232 | icalmemory_free_ring(); | |
231 | return ret; | 233 | return ret; |
232 | } | 234 | } |
233 | 235 | ||
234 | QString ICalFormat::toICalString( Incidence *incidence ) | 236 | QString ICalFormat::toICalString( Incidence *incidence ) |
235 | { | 237 | { |
236 | CalendarLocal cal( mTimeZoneId ); | 238 | CalendarLocal cal( mTimeZoneId ); |
237 | cal.addIncidence( incidence->clone() ); | 239 | cal.addIncidence( incidence->clone() ); |
238 | return toString( &cal ); | 240 | return toString( &cal ); |