diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-03-23 09:44:22 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2016-03-23 09:44:22 -0400 |
commit | 686530d5e8f21ed146a489ad8a477f9241dfc722 (patch) | |
tree | 60f54a108cdb6ff37a685b1f18c19604d3c93fca | |
parent | Merge pull request #530 from mikkeloscar/swaybar-kill-on-sway-crash (diff) | |
parent | swaylock: Fix crash when unable to connect to wl (diff) | |
download | sway-686530d5e8f21ed146a489ad8a477f9241dfc722.tar.gz sway-686530d5e8f21ed146a489ad8a477f9241dfc722.tar.zst sway-686530d5e8f21ed146a489ad8a477f9241dfc722.zip |
Merge pull request #535 from mikkeloscar/fix-swaylock-crash
swaylock: Fix crash when unable to connect to sway
-rw-r--r-- | swaylock/main.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/swaylock/main.c b/swaylock/main.c index f2015a05..3f0fc867 100644 --- a/swaylock/main.c +++ b/swaylock/main.c | |||
@@ -31,7 +31,9 @@ void sway_terminate(int exit_code) { | |||
31 | window_teardown(window); | 31 | window_teardown(window); |
32 | } | 32 | } |
33 | list_free(surfaces); | 33 | list_free(surfaces); |
34 | registry_teardown(registry); | 34 | if (registry) { |
35 | registry_teardown(registry); | ||
36 | } | ||
35 | exit(exit_code); | 37 | exit(exit_code); |
36 | } | 38 | } |
37 | 39 | ||
@@ -292,6 +294,10 @@ int main(int argc, char **argv) { | |||
292 | surfaces = create_list(); | 294 | surfaces = create_list(); |
293 | registry = registry_poll(); | 295 | registry = registry_poll(); |
294 | 296 | ||
297 | if (!registry) { | ||
298 | sway_abort("Unable to connect to wayland compositor"); | ||
299 | } | ||
300 | |||
295 | if (!registry->swaylock) { | 301 | if (!registry->swaylock) { |
296 | sway_abort("swaylock requires the compositor to support the swaylock extension."); | 302 | sway_abort("swaylock requires the compositor to support the swaylock extension."); |
297 | } | 303 | } |