[Commits] vcal_folder.c 1.2.2.118 1.2.2.119 vcal_folder.h 1.1.2.14 1.1.2.15 vcalendar.c 1.2.2.94 1.2.2.95
colin at claws-mail.org
colin at claws-mail.org
Sun Nov 6 13:06:23 CET 2011
Update of /home/claws-mail/plugins/vcalendar/src
In directory claws-mail:/tmp/cvs-serv14547/src
Modified Files:
Tag: gtk2
vcal_folder.c vcal_folder.h vcalendar.c
Log Message:
2011-11-06 [colin] 2.0.11cvs11
* src/vcal_folder.c
* src/vcal_folder.h
* src/vcalendar.c
Fix last recurring events leak. When removing a property
it has to be freed... Also, explicit free at module unload
to avoid false positives.
Index: vcal_folder.h
===================================================================
RCS file: /home/claws-mail/plugins/vcalendar/src/vcal_folder.h,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -u -d -r1.1.2.14 -r1.1.2.15
--- vcal_folder.h 12 Mar 2008 17:25:56 -0000 1.1.2.14
+++ vcal_folder.h 6 Nov 2011 12:06:21 -0000 1.1.2.15
@@ -54,4 +54,5 @@
VCalEvent *vcal_get_event_from_ical(const gchar *ical, const gchar *charset);
+void vcal_folder_free_data(void);
#endif
Index: vcalendar.c
===================================================================
RCS file: /home/claws-mail/plugins/vcalendar/src/vcalendar.c,v
retrieving revision 1.2.2.94
retrieving revision 1.2.2.95
diff -u -d -r1.2.2.94 -r1.2.2.95
--- vcalendar.c 10 Apr 2011 17:33:15 -0000 1.2.2.94
+++ vcalendar.c 6 Nov 2011 12:06:21 -0000 1.2.2.95
@@ -1378,8 +1378,11 @@
icalmemory_free_ring();
+ vcal_folder_free_data();
+
if (mainwin == NULL)
return;
+
summaryview = mainwin->summaryview;
folderview = mainwin->folderview;
fitem = folderview->summaryview->folder_item;
Index: vcal_folder.c
===================================================================
RCS file: /home/claws-mail/plugins/vcalendar/src/vcal_folder.c,v
retrieving revision 1.2.2.118
retrieving revision 1.2.2.119
diff -u -d -r1.2.2.118 -r1.2.2.119
--- vcal_folder.c 6 Nov 2011 09:06:44 -0000 1.2.2.118
+++ vcal_folder.c 6 Nov 2011 12:06:21 -0000 1.2.2.119
@@ -209,7 +209,8 @@
static void slist_free_icalfeeddata(GSList *list)
{
while (list) {
- icalfeeddata_free(list->data);
+ IcalFeedData *data = (IcalFeedData *)list->data;
+ icalfeeddata_free(data);
list = list->next;
}
}
@@ -606,8 +607,10 @@
struct icaltimetype dtstart, dtend;
evt = icalcomponent_new_clone(evt);
prop = icalcomponent_get_first_property(evt, ICAL_RRULE_PROPERTY);
- if (prop)
+ if (prop) {
icalcomponent_remove_property(evt, prop);
+ icalproperty_free(prop);
+ }
prop = icalcomponent_get_first_property(evt, ICAL_DTSTART_PROPERTY);
if (prop)
dtstart = icalproperty_get_dtstart(prop);
@@ -1367,6 +1370,36 @@
return g_slist_reverse(list);
}
+static gboolean vcal_free_data_func(GNode *node, gpointer user_data)
+{
+ VCalFolderItem *item = node->data;
+
+ if (item->cal) {
+ icalcomponent_free(item->cal);
+ item->cal = NULL;
+ }
+ if (item->numlist) {
+ g_slist_free(item->numlist);
+ item->numlist = NULL;
+ }
+
+ if (item->evtlist) {
+ slist_free_icalfeeddata(item->evtlist);
+ g_slist_free(item->evtlist);
+ item->evtlist = NULL;
+ }
+
+ return FALSE;
+}
+
+void vcal_folder_free_data(void)
+{
+ Folder *folder = folder_find_from_name ("vCalendar", vcal_folder_get_class());
+
+ g_node_traverse(folder->node, G_PRE_ORDER,
+ G_TRAVERSE_ALL, -1, vcal_free_data_func, NULL);
+}
+
GSList * vcal_folder_get_webcal_events_for_folder(FolderItem *item)
{
GetWebcalData *data = g_new0(GetWebcalData, 1);
More information about the Commits
mailing list