aboutsummaryrefslogtreecommitdiff
path: root/common/util.c
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2019-12-23 19:17:06 -0500
committerFurkan Sahin <furkan-dev@proton.me>2019-12-23 19:17:06 -0500
commit9843bd761e2155d72d72629cbf410691f2fb8954 (patch)
treefd475828a21222ca6db05a7600efab274117a6fb /common/util.c
parentfd8ef126d31bb79b283997a071d322c3f7cffa6a (diff)
desktop/surface: Fix crash when timer is NULL
When many surfaces are created, sway can run out of file descriptors, making wl_event_loop_add_timer (which creates a timerfd) fail and return NULL. This patch posts a "no memory" error when that is the case, and only removes the timer if it was created. (Why "no memory"? It is not easy to distinguish between failures due to running out of memory and failures due to running out of file descriptors. Also, using the newer `wl_client_post_implementation_error` function would lead to an increased version requirement for the libwayland-server dependency.)
Diffstat (limited to 'common/util.c')
0 files changed, 0 insertions, 0 deletions