]> git.neil.brown.name Git - edlib.git/commitdiff
Discard "Free"
authorNeilBrown <neil@brown.name>
Fri, 8 Sep 2023 12:54:15 +0000 (22:54 +1000)
committerNeilBrown <neil@brown.name>
Fri, 8 Sep 2023 23:52:54 +0000 (09:52 +1000)
"Free" is no longer needed and nothing responds to ti. So stop sending it.

Signed-off-by: NeilBrown <neil@brown.name>
DOC/Developer/01-fundamentals.md
DOC/TODO.md
core-editor.c
core-pane.c
core-pane.h

index 5e9ac8c7d8b53c5bbc61dce1bfc162ec28e9623d..57eb192d4acedf47312ee698ea2f81139f931371 100644 (file)
@@ -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
 
index 4d7717b1b03db532930fe24e932cba1cfec9aaa9..64b42b994916d76e601dd09660291463c6d529d4 100644 (file)
@@ -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
index 89e8f1a3cf913da0f362225abbdd9c0b8b674289..42bbd9114845206de39eb867cb7e40728b808082 100644 (file)
@@ -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);
index 6d05ac3f9fd302e390da3097c7e2eb56163b2615..8026b88d515b1b2724ae9ec126eabc6388c148e0 100644 (file)
@@ -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);
index 87f114ec613c005206acb33188ddb7d2ed12170a..ca24b0d90beda3cc66d7ced6a44b28775bdab965 100644 (file)
@@ -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;