mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-04 06:06:17 +00:00
c/main: Normalize destroy pattern for comp_renderer.
This commit is contained in:
parent
70982e9c39
commit
7c2ea1369f
|
@ -552,10 +552,7 @@ compositor_destroy(struct xrt_compositor *xc)
|
||||||
// Make sure we don't have anything to destroy.
|
// Make sure we don't have anything to destroy.
|
||||||
comp_compositor_garbage_collect(c);
|
comp_compositor_garbage_collect(c);
|
||||||
|
|
||||||
if (c->r) {
|
comp_renderer_destroy(&c->r);
|
||||||
comp_renderer_destroy(c->r);
|
|
||||||
c->r = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
comp_resources_close(c, &c->nr);
|
comp_resources_close(c, &c->nr);
|
||||||
|
|
||||||
|
|
|
@ -120,10 +120,18 @@ comp_renderer_create(struct comp_compositor *c)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
comp_renderer_destroy(struct comp_renderer *r)
|
comp_renderer_destroy(struct comp_renderer **ptr_r)
|
||||||
{
|
{
|
||||||
|
if (ptr_r == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
struct comp_renderer *r = *ptr_r;
|
||||||
|
if (r == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
renderer_destroy(r);
|
renderer_destroy(r);
|
||||||
free(r);
|
free(r);
|
||||||
|
*ptr_r = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -38,11 +38,13 @@ comp_renderer_create(struct comp_compositor *c);
|
||||||
/*!
|
/*!
|
||||||
* Clean up and free the renderer.
|
* Clean up and free the renderer.
|
||||||
*
|
*
|
||||||
|
* Does null checking and sets to null after freeing.
|
||||||
|
*
|
||||||
* @public @memberof comp_renderer
|
* @public @memberof comp_renderer
|
||||||
* @ingroup comp_main
|
* @ingroup comp_main
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
comp_renderer_destroy(struct comp_renderer *r);
|
comp_renderer_destroy(struct comp_renderer **ptr_r);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Render frame.
|
* Render frame.
|
||||||
|
|
Loading…
Reference in a new issue