Small fixes for error handling

This commit is contained in:
Wim Taymans 2017-10-26 15:13:33 +02:00
parent 08aa175a20
commit 0662f3a3ea
7 changed files with 27 additions and 14 deletions

View file

@ -74,7 +74,7 @@ static inline int memfd_create(const char *name, unsigned int flags)
#endif
#undef USE_MEMFD
#define USE_MEMFD
/** Map a memblock
* \param mem a memblock

View file

@ -372,7 +372,7 @@ int pw_port_set_format(struct pw_port *port, uint32_t flags, const struct spa_fo
pw_log_debug("port %p: set format %d", port, res);
if (!SPA_RESULT_IS_ASYNC(res)) {
if (format == NULL) {
if (format == NULL || res < 0) {
if (port->allocated) {
free(port->buffers);
pw_memblock_free(&port->buffer_mem);

View file

@ -1124,11 +1124,12 @@ static void node_proxy_destroy(void *_data)
struct pw_proxy *proxy = (struct pw_proxy*) data->node_proxy;
int i;
for (i = 0; i < data->trans->area->max_input_ports; i++)
clear_port(&data->in_ports[i]);
for (i = 0; i < data->trans->area->max_output_ports; i++)
clear_port(&data->out_ports[i]);
if (data->trans) {
for (i = 0; i < data->trans->area->max_input_ports; i++)
clear_port(&data->in_ports[i]);
for (i = 0; i < data->trans->area->max_output_ports; i++)
clear_port(&data->out_ports[i]);
}
clean_transport(proxy);
spa_hook_remove(&data->node_listener);