aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-02-18 19:10:10 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-02-18 19:10:10 +0800
commita0bb856b78226d72fdbada28f554f717658749ba (patch)
treeb9c2f4cb2fdb9760d68b75c405c364c087ad74c4 /calendar
parent1157f25a6959581bb1ffee62d700f52cb49c7d4b (diff)
downloadgsoc2013-evolution-a0bb856b78226d72fdbada28f554f717658749ba.tar.gz
gsoc2013-evolution-a0bb856b78226d72fdbada28f554f717658749ba.tar.zst
gsoc2013-evolution-a0bb856b78226d72fdbada28f554f717658749ba.zip
** Part of fix for bug #515744
2008-02-18 Milan Crha <mcrha@redhat.com> ** Part of fix for bug #515744 * addressbook/gui/component/addressbook-migrate.c: (get_source_name): * plugins/groupwise-features/send-options.c: (get_source): * plugins/groupwise-features/share-folder-common.c: (get_container_id): * plugins/groupwise-features/install-shared.c: (install_folder_response): * plugins/external-editor/external-editor.c: (convert_to_camel_internet_address), (org_gnome_external_editor): * plugins/itip-formatter/itip-formatter.c: (idle_open_cb): * mail/em-folder-view.c: (emfv_setup_view_instance): * mail/mail-component.c: (impl_finalize): * mail/message-list.c: (ml_tree_value_at): * composer/e-msg-composer.c: (drop_action): * e-util/e-config.c: (ep_finalise): Use proper member to free. * widgets/misc/e-cursors.c: (e_cursors_init): * widgets/misc/e-calendar-item.c: (e_calendar_item_draw_month): * calendar/gui/dialogs/comp-editor.c: (drop_action): * calendar/gui/calendar-config.c: (calendar_config_get_hide_completed_tasks_sexp): * calendar/gui/comp-editor-factory.c: (edit_existing): * calendar/gui/e-day-view.c: (e_day_view_reshape_long_event), (e_day_view_on_top_canvas_drag_data_received): * calendar/gui/e-day-view-main-item.c: (e_day_view_main_item_draw_events_in_vbars), (e_day_view_main_item_draw_long_events_in_vbars): * calendar/gui/e-day-view-top-item.c: (e_day_view_top_item_draw_long_event): * calendar/gui/e-cal-model.c: (redo_queries): * calendar/gui/e-calendar-table.c: (e_calendar_table_open_task): * calendar/gui/e-memo-table.c: (open_memo): * calendar/gui/print.c: (print_todo_details): * calendar/gui/migration.c: (get_source_name): Memory leak fix. * calendar/gui/e-week-view.c: (e_week_view_reshape_events): Simplifies things. svn path=/trunk/; revision=35044
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog22
-rw-r--r--calendar/gui/calendar-config.c1
-rw-r--r--calendar/gui/comp-editor-factory.c1
-rw-r--r--calendar/gui/dialogs/comp-editor.c2
-rw-r--r--calendar/gui/e-cal-model.c5
-rw-r--r--calendar/gui/e-calendar-table.c1
-rw-r--r--calendar/gui/e-day-view-main-item.c40
-rw-r--r--calendar/gui/e-day-view-top-item.c9
-rw-r--r--calendar/gui/e-day-view.c5
-rw-r--r--calendar/gui/e-memo-table.c1
-rw-r--r--calendar/gui/e-week-view.c2
-rw-r--r--calendar/gui/migration.c1
-rw-r--r--calendar/gui/print.c4
13 files changed, 77 insertions, 17 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 58495a446d..9c004bf36b 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,25 @@
+2008-02-18 Milan Crha <mcrha@redhat.com>
+
+ ** Part of fix for bug #515744
+
+ * gui/dialogs/comp-editor.c: (drop_action):
+ * gui/calendar-config.c:
+ (calendar_config_get_hide_completed_tasks_sexp):
+ * gui/comp-editor-factory.c: (edit_existing):
+ * gui/e-day-view.c: (e_day_view_reshape_long_event),
+ (e_day_view_on_top_canvas_drag_data_received):
+ * gui/e-day-view-main-item.c:
+ (e_day_view_main_item_draw_events_in_vbars),
+ (e_day_view_main_item_draw_long_events_in_vbars):
+ * gui/e-day-view-top-item.c: (e_day_view_top_item_draw_long_event):
+ * gui/e-cal-model.c: (redo_queries):
+ * gui/e-calendar-table.c: (e_calendar_table_open_task):
+ * gui/e-memo-table.c: (open_memo):
+ * gui/print.c: (print_todo_details):
+ * gui/migration.c: (get_source_name):
+ Memory leak fix.
+ * gui/e-week-view.c: (e_week_view_reshape_events): Simplifies things.
+
2008-02-18 Srinivasa Ragavan <sragavan@novell.com>
** Fix for bnc #178778
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c
index e8cc126f5d..8599e5ffd8 100644
--- a/calendar/gui/calendar-config.c
+++ b/calendar/gui/calendar-config.c
@@ -1572,6 +1572,7 @@ calendar_config_get_hide_completed_tasks_sexp (gboolean get_completed)
sexp = g_strdup_printf ("(not (completed-before? (make-time \"%s\")))", isodate);
else
sexp = g_strdup_printf ("(completed-before? (make-time \"%s\"))", isodate);
+ g_free (isodate);
}
}
diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c
index 6643d49ecd..99bc173e7b 100644
--- a/calendar/gui/comp-editor-factory.c
+++ b/calendar/gui/comp-editor-factory.c
@@ -281,6 +281,7 @@ edit_existing (OpenClient *oc, const char *uid)
/* Set the object on the editor */
comp_editor_edit_comp (editor, comp);
comp_editor_focus (editor);
+ g_object_unref (comp);
oc->editor_count++;
g_signal_connect (editor, "destroy", G_CALLBACK (editor_destroy_cb), oc);
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index b01667d6dd..5a8be391ee 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -310,7 +310,7 @@ drop_action(CompEditor *editor, GdkDragContext *context, guint32 action, GtkSele
}
}
- g_free (urls);
+ g_strfreev (urls);
success = TRUE;
break;
case DND_TYPE_TEXT_VCARD:
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index 9f2f3c4ada..3fda497431 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -1748,7 +1748,6 @@ static void
redo_queries (ECalModel *model)
{
ECalModelPrivate *priv;
- char *iso_start, *iso_end;
GList *l;
int len;
@@ -1758,6 +1757,8 @@ redo_queries (ECalModel *model)
g_free (priv->full_sexp);
if (priv->start != -1 && priv->end != -1) {
+ char *iso_start, *iso_end;
+
iso_start = isodate_from_time_t (priv->start);
iso_end = isodate_from_time_t (priv->end);
@@ -1766,6 +1767,8 @@ redo_queries (ECalModel *model)
" %s)",
iso_start, iso_end,
priv->search_sexp ? priv->search_sexp : "");
+ g_free (iso_start);
+ g_free (iso_end);
} else if (priv->search_sexp) {
priv->full_sexp = g_strdup (priv->search_sexp);
} else {
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index f649c1b17c..86703be736 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -1075,6 +1075,7 @@ e_calendar_table_open_task (ECalendarTable *cal_table, ECal *client, icalcompone
tedit = COMP_EDITOR (task_editor_new (client, flags));
comp_editor_edit_comp (tedit, comp);
+ g_object_unref (comp);
if (flags & COMP_EDITOR_IS_ASSIGNED)
task_editor_show_assignment (TASK_EDITOR (tedit));
diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c
index 58212f0d8e..d9444c6b7e 100644
--- a/calendar/gui/e-day-view-main-item.c
+++ b/calendar/gui/e-day-view-main-item.c
@@ -373,21 +373,27 @@ e_day_view_main_item_draw_events_in_vbars (EDayViewMainItem *dvmitem,
/* If the event is TRANSPARENT, skip it. */
e_cal_component_get_transparency (comp, &transparency);
- if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT)
+ if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT) {
+ g_object_unref (comp);
continue;
+ }
/* We can skip the events in the first column since they will
draw over this anyway. */
- if (event->num_columns > 0 && event->start_row_or_col == 0)
+ if (event->num_columns > 0 && event->start_row_or_col == 0) {
+ g_object_unref (comp);
continue;
+ }
bar_y = event->start_minute * day_view->row_height / day_view->mins_per_row;
bar_h = event->end_minute * day_view->row_height / day_view->mins_per_row - bar_y;
bar_y -= y;
/* Skip it if it isn't visible. */
- if (bar_y >= height || bar_y + bar_h <= 0)
+ if (bar_y >= height || bar_y + bar_h <= 0) {
+ g_object_unref (comp);
continue;
+ }
gdk_draw_rectangle (drawable, gc, TRUE,
grid_x, bar_y,
@@ -427,14 +433,18 @@ e_day_view_main_item_draw_long_events_in_vbars (EDayViewMainItem *dvmitem,
/* If the event is TRANSPARENT, skip it. */
e_cal_component_get_transparency (comp, &transparency);
- if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT)
+ if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT) {
+ g_object_unref (comp);
continue;
+ }
if (!e_day_view_find_long_event_days (event,
day_view->days_shown,
day_view->day_starts,
- &start_day, &end_day))
+ &start_day, &end_day)) {
+ g_object_unref (comp);
continue;
+ }
for (day = start_day; day <= end_day; day++) {
grid_x = day_view->day_offsets[day] + 1 - x;
@@ -1099,21 +1109,27 @@ e_day_view_main_item_draw_events_in_vbars (EDayViewMainItem *dvmitem,
/* If the event is TRANSPARENT, skip it. */
e_cal_component_get_transparency (comp, &transparency);
- if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT)
+ if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT) {
+ g_object_unref (comp);
continue;
+ }
/* We can skip the events in the first column since they will
draw over this anyway. */
- if (event->num_columns > 0 && event->start_row_or_col == 0)
+ if (event->num_columns > 0 && event->start_row_or_col == 0) {
+ g_object_unref (comp);
continue;
+ }
bar_y = event->start_minute * day_view->row_height / day_view->mins_per_row;
bar_h = event->end_minute * day_view->row_height / day_view->mins_per_row - bar_y;
bar_y -= y;
/* Skip it if it isn't visible. */
- if (bar_y >= height || bar_y + bar_h <= 0)
+ if (bar_y >= height || bar_y + bar_h <= 0) {
+ g_object_unref (comp);
continue;
+ }
cairo_rectangle (cr, grid_x, bar_y,
E_DAY_VIEW_BAR_WIDTH - 2, bar_h);
@@ -1169,14 +1185,18 @@ e_day_view_main_item_draw_long_events_in_vbars (EDayViewMainItem *dvmitem,
/* If the event is TRANSPARENT, skip it. */
e_cal_component_get_transparency (comp, &transparency);
- if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT)
+ if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT) {
+ g_object_unref (comp);
continue;
+ }
if (!e_day_view_find_long_event_days (event,
day_view->days_shown,
day_view->day_starts,
- &start_day, &end_day))
+ &start_day, &end_day)) {
+ g_object_unref (comp);
continue;
+ }
for (day = start_day; day <= end_day; day++) {
grid_x = day_view->day_offsets[day] + 1 - x;
diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c
index e04c3e2345..5f75237ec6 100644
--- a/calendar/gui/e-day-view-top-item.c
+++ b/calendar/gui/e-day-view-top-item.c
@@ -428,8 +428,10 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem,
/* If we are editing the event we don't show the icons or the start
& end times. */
if (day_view->editing_event_day == E_DAY_VIEW_LONG_EVENT
- && day_view->editing_event_num == event_num)
+ && day_view->editing_event_num == event_num) {
+ g_object_unref (comp);
return;
+ }
/* Determine the position of the label, so we know where to place the
icons. Note that since the top canvas never scrolls we don't need
@@ -1048,8 +1050,11 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem,
/* If we are editing the event we don't show the icons or the start
& end times. */
if (day_view->editing_event_day == E_DAY_VIEW_LONG_EVENT
- && day_view->editing_event_num == event_num)
+ && day_view->editing_event_num == event_num) {
+ g_object_unref (comp);
+ cairo_destroy (cr);
return;
+ }
/* Determine the position of the label, so we know where to place the
icons. Note that since the top canvas never scrolls we don't need
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 29468c30c8..bea06bc959 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -5795,6 +5795,7 @@ e_day_view_reshape_long_event (EDayView *day_view,
text_x, item_y);
g_object_unref (layout);
+ g_object_unref (comp);
}
@@ -9085,8 +9086,10 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
e_cal_component_commit_sequence (comp);
if (e_cal_component_is_instance (comp)) {
- if (!recur_component_dialog (client, comp, &mod, NULL, FALSE))
+ if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) {
+ g_object_unref (comp);
return;
+ }
if (mod == CALOBJ_MOD_THIS) {
e_cal_component_set_rdate_list (comp, NULL);
diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c
index b8e55c6aaf..e877ccd940 100644
--- a/calendar/gui/e-memo-table.c
+++ b/calendar/gui/e-memo-table.c
@@ -764,6 +764,7 @@ open_memo (EMemoTable *memo_table, ECalModelComponent *comp_data)
medit = COMP_EDITOR (memo_editor_new (comp_data->client, flags));
comp_editor_edit_comp (medit, comp);
+ g_object_unref (comp);
e_comp_editor_registry_add (comp_editor_registry, medit, FALSE);
}
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index e6dd84ad66..6dc8d0e73d 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -2525,9 +2525,9 @@ e_week_view_reshape_events (EWeekView *week_view)
e_week_view_reshape_event_span (week_view, event_num,
span_num);
- current_comp_string = icalcomponent_as_ical_string (event->comp_data->icalcomp);
if (week_view->last_edited_comp_string == NULL)
continue;
+ current_comp_string = icalcomponent_as_ical_string (event->comp_data->icalcomp);
if (strncmp (current_comp_string, week_view->last_edited_comp_string,50) == 0) {
EWeekViewEventSpan *span;
span = &g_array_index (week_view->spans, EWeekViewEventSpan, event->spans_index + span_num);
diff --git a/calendar/gui/migration.c b/calendar/gui/migration.c
index 3ed7d9fb5c..5a798c8e74 100644
--- a/calendar/gui/migration.c
+++ b/calendar/gui/migration.c
@@ -279,6 +279,7 @@ get_source_name (ESourceGroup *group, const char *path)
break;
} while (conflict);
+ g_strfreev (p);
return g_string_free (s, FALSE);
}
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index 7227cad3dc..af6f3b6978 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -1992,8 +1992,10 @@ print_todo_details (GtkPrintContext *context, GnomeCalendar *gcal,
x = left;
xend = right - 2;
- if (y > bottom)
+ if (y > bottom) {
+ g_object_unref (comp);
break;
+ }
/* Print the box to put the tick in. */
print_border (context, x + 2, x + 8, y + 6, y + 15, 0.1, -1.0);