Skip to content

Commit

Permalink
Initialise VNC last
Browse files Browse the repository at this point in the history
This fixes deinitialisation ordering and makes it so that we don't start
listening until everything else is initialised.
  • Loading branch information
any1 committed Jun 4, 2024
1 parent b7de0d9 commit 50f095d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1929,9 +1929,6 @@ int main(int argc, char* argv[])
else if (use_websocket)
socket_type = SOCKET_TYPE_WEBSOCKET;

if (init_nvnc(&self, address, port, socket_type) < 0)
goto nvnc_failure;

if (!start_detached) {
if (self.screencopy.manager)
screencopy_init(&self.screencopy);
Expand Down Expand Up @@ -1964,6 +1961,9 @@ int main(int argc, char* argv[])
if (!self.ctl)
goto ctl_server_failure;

if (init_nvnc(&self, address, port, socket_type) < 0)
goto nvnc_failure;

if (self.display)
wl_display_dispatch_pending(self.display);

Expand Down Expand Up @@ -1997,11 +1997,10 @@ int main(int argc, char* argv[])

return 0;

nvnc_failure:
ctl_server_destroy(self.ctl);
ctl_server_failure:
capture_failure:
nvnc_display_unref(self.nvnc_display);
nvnc_close(self.nvnc);
nvnc_failure:
wayland_failure:
aml_unref(aml);
failure:
Expand Down

0 comments on commit 50f095d

Please sign in to comment.