aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-08-19 22:03:57 -0400
committerGitHub <noreply@github.com>2018-08-19 22:03:57 -0400
commitfdcf9275b1259deda94723853a60cbaa9cbb522a (patch)
treeeef53d774ae0970c1912fe3420dbae8d751c91a6 /sway/desktop
parent8db6c68db640e8535ed71a0369323538f0910d7e (diff)
parentb3e2c497742197bbeb7270fcc882f641cf84a612 (diff)
Merge pull request #2496 from RyanDwyer/fix-transaction-crash
Fix crash when a view destroys with pending transactions
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/transaction.c6
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) {
sizeof(struct sway_container_state));
if (container->type == C_VIEW && container->sway_view->saved_buffer) {
- view_remove_saved_buffer(container->sway_view);
+ if (!container->destroying || container->ntxnrefs == 1) {
+ view_remove_saved_buffer(container->sway_view);
+ }
}
// Damage the new location
@@ -283,7 +285,7 @@ static void transaction_commit(struct sway_transaction *transaction) {
struct timespec when;
wlr_surface_send_frame_done(con->sway_view->surface, &when);
}
- if (con->type == C_VIEW) {
+ if (con->type == C_VIEW && !con->sway_view->saved_buffer) {
view_save_buffer(con->sway_view);
memcpy(&con->sway_view->saved_geometry, &con->sway_view->geometry,
sizeof(struct wlr_box));