Paolo wrote: > > Hi Archit, > > (I've cc'ed Joaquin since the attached patch is big and maybe > the mail will not reach the list) > > Attached there is the current diff of my tree against cvs > where I think I've fixed this bug (along with some others and > along with adding some new ones ;) ) > > If you could verify/review the patch it would be great! > > On Sun, 2003-06-01 at 03:07, Archit Baweja wrote: > > Well I had been testing my undo/redo code for cut/paste a lot, as I > > wrote it. > > I haven't fixed it yet, but just thought I'd mention it to > you guys. Try this > > out > > > > Create window > > Add a hbox > > Add a button > > Now cut and then paste 3 times the button > > Now keep doing undo > > When it is time to undo the first cut (thats the third time it is > > *supposed* to show up again), it crashes. > > > > What I think is the problem is that every cut creates a new > placeholder, so when you undo the first cut what happens is > that it tries to paste on a placeholder which isn't there anymore. > > The main fixes to this is in command.c where I ref the > placeholders and in glade_widget_replace_with_placeholder > where I pass the placeholder instead of always creating a new one. > > I'm sorry that I attached the whole diff containing other > changes but extracting only that one was a bit painful. The > description of the other changes follows below. It also > contains cleanups to project/placeholder/widget I already > submitted separately to the list.
I've committed the patch, but I've changed where the ref happens. Now, we ref a widget & the placeholder when we create/destroy/cut/paste it. That's, at the very beginning of the operation (as we're referencing the widgets on cmd->widget & cmd->placeholder). When we destroy the operation, we unref them. When we replace the widget with a new placeholder, then we ref the new placeholder. That's all. This way we should be safe & not leak. At least it's working here[TM], and it looks more natural than the current "ops, we're going to remove the widget from its parent, reference it now or it will be destroyed" :-) P.S.: Paolo, am I still missing some of your patches, or this big patch had everything? Cheers, _______________________________________________ Glade-devel maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/glade-devel
