Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Re: Bug: Callback to widget set with `zle -Fw <widget>` shouldn't change $LASTWIDGET



On Mon, Jul 17, 2023 at 8:52 AM dana <dana@xxxxxxx> wrote:
>
> Sorry, i'm not very familiar with the LASTWIDGET mechanism, but by the patch
> at the start of this thread you mean workers/51310, right? It was committed
> as f93ad02b94bd

(Facepalm)  Looked at the wrong source file.

> I should have mentioned that i did a (manual) bisect to confirm that that is
> when the problem started for me; the poster in workers/51673 found the same

OK, then it IS a reference counting problem.  Try this.

diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 4a6c02133..6e554f4b8 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -737,7 +737,7 @@ raw_getbyte(long do_keytmout, char *cptr, int full)
             ) {
             /* Handle the fd. */
             char *fdbuf;
-            Thingy save_lbindk = lbindk;
+            Thingy save_lbindk = refthingy(lbindk);
             {
                 char buf[BDIGBUFSIZE];
                 convbase(buf, lwatch_fd->fd, 10);
@@ -781,6 +781,7 @@ raw_getbyte(long do_keytmout, char *cptr, int full)
                 errtry = 1;
             }
             lbindk = save_lbindk;
+            unrefthingy(save_lbindk);
             }
         }
         /* Function may have invalidated the display. */




Messages sorted by: Reverse Date, Date, Thread, Author