From: NeilBrown Date: Fri, 8 Sep 2023 12:54:15 +0000 (+1000) Subject: Discard "Free" X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=68bff007db9ae1e9419abb7d6a121a21913b8ee9;p=edlib.git Discard "Free" "Free" is no longer needed and nothing responds to ti. So stop sending it. Signed-off-by: NeilBrown --- diff --git a/DOC/Developer/01-fundamentals.md b/DOC/Developer/01-fundamentals.md index 5e9ac8c7..57eb192d 100644 --- a/DOC/Developer/01-fundamentals.md +++ b/DOC/Developer/01-fundamentals.md @@ -52,7 +52,7 @@ how much room there is for the display, the x,y locations position the image within the parent, and the depth is use to resolve situations where two panes overlap. -FIXME mention "Close" and "Free" +FIXME mention "Close" ### relevant interfaces diff --git a/DOC/TODO.md b/DOC/TODO.md index 4d7717b1..64b42b99 100644 --- a/DOC/TODO.md +++ b/DOC/TODO.md @@ -83,7 +83,7 @@ Core features should be much easier - [ ] gather memory usage stats per-pane and allow a dump - [ ] show doc size in doc list - include undo size? -- [ ] Ensure all panes that should use "Free" properly, and find some +- [X] Ensure all panes that should use "Free" properly, and find some way to encourage its use. - [ ] Add optional unit-test interface for modules. This should be implemented at least by lib-search, doc-text and probably many diff --git a/core-editor.c b/core-editor.c index 89e8f1a3..42bbd911 100644 --- a/core-editor.c +++ b/core-editor.c @@ -307,8 +307,6 @@ DEF_CMD(editor_free_panes) ei->freelist = p->focus; p->focus = NULL; - p->damaged &= ~DAMAGED_DEAD; - pane_call(p, "Free", p); command_put(p->handle); p->handle = NULL; attr_free(&p->attrs); @@ -433,8 +431,6 @@ void editor_delayed_free(struct pane *ed safe, struct pane *p safe) { struct ed_info *ei = ed->data; if (!ei) { - p->damaged &= ~DAMAGED_DEAD; - pane_call(p, "Free", p); command_put(p->handle); p->handle = NULL; attr_free(&p->attrs); diff --git a/core-pane.c b/core-pane.c index 6d05ac3f..8026b88d 100644 --- a/core-pane.c +++ b/core-pane.c @@ -625,11 +625,10 @@ void pane_close(struct pane *p safe) /* If a child has not yet had "Close" called, we need to leave * ->parent in place so a full range of commands are available. */ + p->damaged |= DAMAGED_DEAD; if (ed != p) { - p->damaged |= DAMAGED_DEAD; editor_delayed_free(ed, p); } else { - pane_call(p, "Free", p); command_put(p->handle); p->handle = NULL; attr_free(&p->attrs); diff --git a/core-pane.h b/core-pane.h index 87f114ec..ca24b0d9 100644 --- a/core-pane.h +++ b/core-pane.h @@ -133,10 +133,9 @@ static inline int do_call_val(enum target_type type, struct pane *home, ci.home = home; if ((home->damaged & DAMAGED_CLOSED) && strncmp(ci.key, "Close", 5) != 0 && - strcmp(ci.key, "Notify:Close") != 0 && - strcmp(ci.key, "Free") != 0) + strcmp(ci.key, "Notify:Close") != 0) /* This pane cannot accept anything but - * "Close" or "Close:mark" or "Free" + * "Close" or "Close:mark" or "Notify:Close" */ return Efail; ci.comm = home->handle;