Re: [Planner Dev] Transaction bug
- From: Jani Tiainen <redetin luukku com>
- To: planner-dev lists imendio com
- Subject: Re: [Planner Dev] Transaction bug
- Date: Thu, 03 Mar 2005 15:45:15 +0200
fmoraes nc rr com kirjoitti:
I've played a bit with transactions for removing resources. There is a small bug in the undo for a transaction:
static void
transaction_cmd_undo (PlannerCmd *cmd)
{
PlannerCmd *cmd_sub;
g_print ("Transaction undo: %s\n", cmd->name);
while (1) {
cmd_sub = get_undo_cmd (cmd->manager, TRUE);
if (!cmd_sub) {
break;
}
if (cmd_sub->undo_func) {
cmd_sub->undo_func (cmd_sub);
}
if (cmd_sub->type == PLANNER_CMD_TYPE_BEGIN_TRANSACTION) {
break;
}
g_assert (cmd_sub->type == PLANNER_CMD_TYPE_NORMAL);
}
}
The block:
if (cmd_sub->type == PLANNER_CMD_TYPE_BEGIN_TRANSACTION) {
break;
}
needs to be moved before the call to the undo function, otherwise the undo will go all the way back to the top of the undo history.
Sorry, I don't have a patch at the moment, but it is trivial to change.
Oh, so this was the reason I always lost undo buffer...!
Thank you very much for finding out this one.
--
Jani Tiainen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]