summaryrefslogtreecommitdiff
path: root/modules/aubridge/play.c
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2015-06-16 21:49:43 +0200
committerAlfred E. Heggestad <aeh@db.org>2015-06-16 21:49:43 +0200
commit500a7d1de384e37d609476f84dce207cccf88dc2 (patch)
tree496ad61eb5d19117470fabcb8bdb62587a374769 /modules/aubridge/play.c
parent55fe148705d206d206f61dd9aa119a6672378e07 (diff)
change ausrc/auplay base-class to pointer
- change from a memory-reference to a const pointer - this saves one mem_deref() in the destructor and also decreases the chance of introducing memory leaks - test on debian
Diffstat (limited to 'modules/aubridge/play.c')
-rw-r--r--modules/aubridge/play.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/aubridge/play.c b/modules/aubridge/play.c
index c31792c..37c04fa 100644
--- a/modules/aubridge/play.c
+++ b/modules/aubridge/play.c
@@ -15,11 +15,10 @@ static void auplay_destructor(void *arg)
device_stop(st->dev);
mem_deref(st->dev);
- mem_deref(st->ap);
}
-int play_alloc(struct auplay_st **stp, struct auplay *ap,
+int play_alloc(struct auplay_st **stp, const struct auplay *ap,
struct auplay_prm *prm, const char *device,
auplay_write_h *wh, void *arg)
{
@@ -33,7 +32,7 @@ int play_alloc(struct auplay_st **stp, struct auplay *ap,
if (!st)
return ENOMEM;
- st->ap = mem_ref(ap);
+ st->ap = ap;
st->prm = *prm;
st->wh = wh;
st->arg = arg;