mirror of
https://git.sr.ht/~leon_plickat/wlopm
synced 2024-11-16 02:18:25 +01:00
Fix segfault when required protocol not supported
This commit is contained in:
parent
ff86018415
commit
e3f245394a
7
wlopm.c
7
wlopm.c
@ -124,6 +124,7 @@ static void registry_handle_global (void *data, struct wl_registry *registry,
|
|||||||
output->wl_output = wl_registry_bind(registry, name,
|
output->wl_output = wl_registry_bind(registry, name,
|
||||||
&wl_output_interface, version);
|
&wl_output_interface, version);
|
||||||
output->xdg_output = NULL;
|
output->xdg_output = NULL;
|
||||||
|
output->wlr_output_power = NULL;
|
||||||
output->name = NULL;
|
output->name = NULL;
|
||||||
output->global_name = name;
|
output->global_name = name;
|
||||||
|
|
||||||
@ -282,8 +283,10 @@ int main(int argc, char *argv[])
|
|||||||
struct Output *output, *tmp;
|
struct Output *output, *tmp;
|
||||||
wl_list_for_each_safe(output, tmp, &outputs, link)
|
wl_list_for_each_safe(output, tmp, &outputs, link)
|
||||||
{
|
{
|
||||||
zwlr_output_power_v1_destroy(output->wlr_output_power);
|
if ( output->wlr_output_power != NULL )
|
||||||
zxdg_output_v1_destroy(output->xdg_output);
|
zwlr_output_power_v1_destroy(output->wlr_output_power);
|
||||||
|
if ( output->xdg_output != NULL )
|
||||||
|
zxdg_output_v1_destroy(output->xdg_output);
|
||||||
wl_output_destroy(output->wl_output);
|
wl_output_destroy(output->wl_output);
|
||||||
wl_list_remove(&output->link);
|
wl_list_remove(&output->link);
|
||||||
free(output->name);
|
free(output->name);
|
||||||
|
Loading…
Reference in New Issue
Block a user