commit: 2912f3fe5402494aedcab01138af1e7155b89eed
parent ad088a4378b49acae93549c0eef608628aaf88ca
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Fri, 4 Dec 2020 03:29:40 +0100
Add assert on server.backend
This makes scan-build(1) happy, not sure why it's reporting that
``wl_list_init(&server.outputs);`` stores a NULL pointer to server.backend
Diffstat:
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/inaban.c b/inaban.c
@@ -13,6 +13,7 @@
#include <time.h>
#include <unistd.h> /* execvp() */
#include <unistd.h>
+#include <assert.h>
#define LENGTH(X) (sizeof X / sizeof X[0])
@@ -224,11 +225,9 @@ process_cursor_motion(struct inaban_server *server, uint32_t time)
else if(server->cursor_mode == INABAN_CURSOR_RESIZE)
{
struct inaban_view *view = server->grabbed_view;
- int width = server->grab_width;
- int height = server->grab_height;
- width = server->cursor->x - server->grab_x;
- height = server->cursor->y - server->grab_y;
+ int width = server->cursor->x - server->grab_x;
+ int height = server->cursor->y - server->grab_y;
wlr_xdg_toplevel_set_size(view->xdg_surface, width, height);
}
@@ -698,6 +697,7 @@ main(int argc, char *argv[])
* backend. */
wl_list_init(&server.outputs);
server.new_output.notify = server_new_output;
+ assert(server.backend);
wl_signal_add(&server.backend->events.new_output, &server.new_output);
/* Set up our list of views and the xdg-shell. The xdg-shell is a Wayland
@@ -817,6 +817,7 @@ main(int argc, char *argv[])
wl_display_run(server.wl_display);
end:
+ if(server.seat) wlr_seat_destroy(server.seat);
wl_display_destroy_clients(server.wl_display);
wl_display_destroy(server.wl_display);
return ret;