---
name: "roar_connectionunref"
section: "3"
platform: "linux"
package: "libroar-dev"
version: "1.0~beta12-4"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/roar_connectionunref"
---

# roar\_connectionunref(3)

change reference counter for RoarAudio connections

## NAME

roar\_connectionref, roar\_connectionunref - change reference counter for RoarAudio connections

## SYNOPSIS

\#include \<roaraudio.h\>

int roar\_connectionref(struct roar\_connection \* con);

int roar\_connectionunref(struct roar\_connection \* con);

\#define roar\_disconnect(x) roar\_connectionunref((x))

## DESCRIPTION

Those functions change the reference counter for connection objects previously opend via [**roar\_connect**(3)](/roar_connect/3.md), **roar\_connect\_fh**(3) or [**roar\_simple\_connect**(3)](/roar_simple_connect/3.md). If the reference counter hints zero the connection is closed and the object is destroyed.

The [**roar\_disconnect**(3)](/roar_disconnect/3.md) macro is provided to be source compatible (recompile needed) with RoarAudio 0.4 or older.

## PARAMETERS

- **con**

  The connection to be altered.

## RETURN VALUE

On success these calls return 0.  On error, -1 is returned.

## EXAMPLES

FIXME

## SEE ALSO

[**roar\_simple\_connect**(3)](/roar_simple_connect/3.md), [**libroar**(7)](/libroar/7.md), [**RoarAudio**(7)](/RoarAudio/7.md).
