summaryrefslogtreecommitdiffstats
path: root/debian/patches/upstream-6c0067c103.diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--debian/patches/upstream-6c0067c103.diff (renamed from debian/patches/upstream-PR-3860.diff)47
1 files changed, 18 insertions, 29 deletions
diff --git a/debian/patches/upstream-PR-3860.diff b/debian/patches/upstream-6c0067c103.diff
index 4711745..ed9423b 100644
--- a/debian/patches/upstream-PR-3860.diff
+++ b/debian/patches/upstream-6c0067c103.diff
@@ -1,23 +1,12 @@
-From 5363a5475a1dd4158c1ddb23de2da34e88738673 Mon Sep 17 00:00:00 2001
-From: Romain Francoise <romain@rfr.io>
-Date: Sun, 25 Feb 2024 15:53:25 +0100
-Subject: [PATCH] Don't notify when unzooming windows from window_destroy()
+commit 6c0067c10360880334afa50815b880d04edcbf42
+Author: Nicholas Marriott <nicholas.marriott@gmail.com>
+Date: Thu Mar 21 11:30:42 2024 +0000
-Since commit 36e1ac65560, window_destroy() calls window_unzoom()
-but the latter emits a 'window-layout-changed' notification with
-the window which is about to be freed. This results in the
-callback later dereferencing a freed window, or a double-free.
+ Do not notify window-layout-changed if the window is about to be
+ destroyed (since it may have been freed by the time the notify happens),
+ from Romain Francoise in GitHub issue 3860.
-Closes: #3857.
----
- cmd-display-panes.c | 2 +-
- cmd-resize-pane.c | 2 +-
- popup.c | 2 +-
- resize.c | 2 +-
- server-fn.c | 2 +-
- tmux.h | 2 +-
- window.c | 10 ++++++----
- 7 files changed, 12 insertions(+), 10 deletions(-)
+Origin: upstream, https://github.com/tmux/tmux/commit/6c0067c10360880334afa50815b880d04edcbf42
diff --git a/cmd-display-panes.c b/cmd-display-panes.c
index 06f6dc277a..25556f3d58 100644
@@ -46,10 +35,10 @@ index c9439441f6..b2c167f59f 100644
window_zoom(wp);
server_redraw_window(w);
diff --git a/popup.c b/popup.c
-index 4742733932..01b95e27b8 100644
+index 38a4c17fdf..804dd6ef07 100644
--- a/popup.c
+++ b/popup.c
-@@ -345,7 +345,7 @@ popup_make_pane(struct popup_data *pd, enum layout_type type)
+@@ -346,7 +346,7 @@ popup_make_pane(struct popup_data *pd, enum layout_type type)
u_int hlimit;
const char *shell;
@@ -72,10 +61,10 @@ index 457fee0a7b..dff9571270 100644
/* Resize the layout first. */
layout_resize(w, sx, sy);
diff --git a/server-fn.c b/server-fn.c
-index 2f649329cb..00d0e37843 100644
+index 8d66bce913..052169568f 100644
--- a/server-fn.c
+++ b/server-fn.c
-@@ -488,6 +488,6 @@ server_check_unattached(void)
+@@ -487,6 +487,6 @@ server_check_unattached(void)
void
server_unzoom_window(struct window *w)
{
@@ -84,10 +73,10 @@ index 2f649329cb..00d0e37843 100644
server_redraw_window(w);
}
diff --git a/tmux.h b/tmux.h
-index a50adbfae0..7671cca097 100644
+index e6516a7251..f61d1032eb 100644
--- a/tmux.h
+++ b/tmux.h
-@@ -3070,7 +3070,7 @@ struct window_pane *window_add_pane(struct window *, struct window_pane *,
+@@ -3021,7 +3021,7 @@ struct window_pane *window_add_pane(struct window *, struct window_pane *,
void window_resize(struct window *, u_int, u_int, int, int);
void window_pane_send_resize(struct window_pane *, u_int, u_int);
int window_zoom(struct window_pane *);
@@ -97,10 +86,10 @@ index a50adbfae0..7671cca097 100644
int window_pop_zoom(struct window *);
void window_lost_pane(struct window *, struct window_pane *);
diff --git a/window.c b/window.c
-index 77ce41d8f7..69a42ab7e6 100644
+index c5d00e29fe..43c272bc8e 100644
--- a/window.c
+++ b/window.c
-@@ -338,7 +338,7 @@ window_destroy(struct window *w)
+@@ -340,7 +340,7 @@ window_destroy(struct window *w)
{
log_debug("window @%u destroyed (%d references)", w->id, w->references);
@@ -109,7 +98,7 @@ index 77ce41d8f7..69a42ab7e6 100644
RB_REMOVE(windows, &windows, w);
if (w->layout_root != NULL)
-@@ -673,7 +673,7 @@ window_zoom(struct window_pane *wp)
+@@ -666,7 +666,7 @@ window_zoom(struct window_pane *wp)
}
int
@@ -118,7 +107,7 @@ index 77ce41d8f7..69a42ab7e6 100644
{
struct window_pane *wp;
-@@ -690,7 +690,9 @@ window_unzoom(struct window *w)
+@@ -683,7 +683,9 @@ window_unzoom(struct window *w)
wp->saved_layout_cell = NULL;
}
layout_fix_panes(w, NULL);
@@ -129,7 +118,7 @@ index 77ce41d8f7..69a42ab7e6 100644
return (0);
}
-@@ -704,7 +706,7 @@ window_push_zoom(struct window *w, int always, int flag)
+@@ -697,7 +699,7 @@ window_push_zoom(struct window *w, int always, int flag)
w->flags |= WINDOW_WASZOOMED;
else
w->flags &= ~WINDOW_WASZOOMED;