diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-08-19 22:03:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-19 22:03:57 -0400 |
commit | fdcf9275b1259deda94723853a60cbaa9cbb522a (patch) | |
tree | eef53d774ae0970c1912fe3420dbae8d751c91a6 | |
parent | Merge pull request #2493 from RyanDwyer/fix-popup-position (diff) | |
parent | Fix crash when a view destroys with pending transactions (diff) | |
download | sway-fdcf9275b1259deda94723853a60cbaa9cbb522a.tar.gz sway-fdcf9275b1259deda94723853a60cbaa9cbb522a.tar.zst sway-fdcf9275b1259deda94723853a60cbaa9cbb522a.zip |
Merge pull request #2496 from RyanDwyer/fix-transaction-crash
Fix crash when a view destroys with pending transactions
-rw-r--r-- | sway/desktop/transaction.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index d77a2afd..3b626cb7 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -175,7 +175,9 @@ static void transaction_apply(struct sway_transaction *transaction) { | |||
175 | sizeof(struct sway_container_state)); | 175 | sizeof(struct sway_container_state)); |
176 | 176 | ||
177 | if (container->type == C_VIEW && container->sway_view->saved_buffer) { | 177 | if (container->type == C_VIEW && container->sway_view->saved_buffer) { |
178 | view_remove_saved_buffer(container->sway_view); | 178 | if (!container->destroying || container->ntxnrefs == 1) { |
179 | view_remove_saved_buffer(container->sway_view); | ||
180 | } | ||
179 | } | 181 | } |
180 | 182 | ||
181 | // Damage the new location | 183 | // Damage the new location |
@@ -283,7 +285,7 @@ static void transaction_commit(struct sway_transaction *transaction) { | |||
283 | struct timespec when; | 285 | struct timespec when; |
284 | wlr_surface_send_frame_done(con->sway_view->surface, &when); | 286 | wlr_surface_send_frame_done(con->sway_view->surface, &when); |
285 | } | 287 | } |
286 | if (con->type == C_VIEW) { | 288 | if (con->type == C_VIEW && !con->sway_view->saved_buffer) { |
287 | view_save_buffer(con->sway_view); | 289 | view_save_buffer(con->sway_view); |
288 | memcpy(&con->sway_view->saved_geometry, &con->sway_view->geometry, | 290 | memcpy(&con->sway_view->saved_geometry, &con->sway_view->geometry, |
289 | sizeof(struct wlr_box)); | 291 | sizeof(struct wlr_box)); |