Re: [Planner Dev] Last patch for undo resource dialog: undo calendar selection
- From: Richard Hult <richard imendio com>
- To: acs lambdaux com, Planner Project Manager - Development List <planner-dev lists imendio com>
- Cc:
- Subject: Re: [Planner Dev] Last patch for undo resource dialog: undo calendar selection
- Date: Sat, 01 May 2004 19:44:09 +0200
On lör, 2004-05-01 at 12:54 +0000, Alvaro del Castillo wrote:
> Hi guys!
>
> Here goes the last patch, if we don't find some prob, to implement the
> undo system in the resource dialog. It implements undoing the calendar
> selection.
>
> Also I have found a bug that crash planner undoing the note in the
> resource note editor and it is solved with this patch also (using a
> DialogData when it could be destroyed to store data).
The patch looks good, except for one thing, that I think is wrong
everywhere else in the undo code:
+static void
+resource_cmd_calendar_free (PlannerCmd *cmd_base)
+{
+ ResourceCmdCalendar *cmd;
+
+ cmd = (ResourceCmdCalendar *) cmd_base;
+
+ g_free (cmd_base->label);
+ g_object_unref (cmd->resource);
+
+ if (cmd->old_calendar) {
+ g_object_unref (cmd->calendar);
+ }
+ if (cmd->old_calendar) {
+ g_object_unref (cmd->old_calendar);
+ }
+
+ g_free (cmd);
+}
You should only free stuff in the cmd struct, not the cmd_base one. The
undo manager should take care of the rest, including the cmd itself.
/Richard
--
Imendio HB, http://www.imendio.com/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]