glue(hw->pcm_ops->fini_, TYPE) (hw);
glue(s->nb_hw_voices_, TYPE) += 1;
glue(audio_pcm_hw_free_resources_ , TYPE) (hw);
+ object_unref(hw->s);
g_free(hw);
*hwp = NULL;
}
* is guaranteed to be != 0. See the audio_init_nb_voices_* functions.
*/
hw = g_malloc0(glue(drv->voice_size_, TYPE));
- hw->s = s;
+ hw->s = AUDIO_MIXENG_BACKEND(object_ref(s));
hw->pcm_ops = drv->pcm_ops;
QLIST_INIT (&hw->sw_head);
err1:
glue (hw->pcm_ops->fini_, TYPE) (hw);
err0:
+ object_unref(hw->s);
g_free (hw);
return NULL;
}
}
sw = g_new0(SW, 1);
- sw->s = s;
+ sw->s = AUDIO_MIXENG_BACKEND(object_ref(s));
hw = glue(audio_pcm_hw_add_, TYPE)(s, &hw_as);
if (!hw) {
glue (audio_pcm_hw_del_sw_, TYPE) (sw);
glue (audio_pcm_hw_gc_, TYPE) (&hw);
err1:
+ object_unref(sw->s);
g_free(sw);
return NULL;
}
glue (audio_pcm_sw_fini_, TYPE) (sw);
glue (audio_pcm_hw_del_sw_, TYPE) (sw);
glue (audio_pcm_hw_gc_, TYPE) (&sw->hw);
+
+ object_unref(sw->s);
g_free (sw);
}