From 93d52e994ccf5597413180c5a3c401286112891d Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Mon, 7 May 2001 23:02:25 +0000 Subject: mix_device_t: virtual destructor added --- mixlib/xmix_device.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'mixlib/xmix_device.c') diff --git a/mixlib/xmix_device.c b/mixlib/xmix_device.c index c93153a..db343ad 100644 --- a/mixlib/xmix_device.c +++ b/mixlib/xmix_device.c @@ -1,7 +1,7 @@ /* -*-c-*- -------------- xmix_device.c : * Implementation of the functions declared in xmix_device.h * ------------------------------------------------------------------ - * Last change: Time-stamp: "2001-05-04 23:40:31 jao" + * Last change: Time-stamp: "2001-05-07 23:49:31 jao" * ------------------------------------------------------------------ * Copyright (C) 2001 Free Software Foundation, Inc. * @@ -169,8 +169,15 @@ busy_ (const mix_device_t *dev) return (!mix_io_is_ready (GET_CHANNEL_(dev))); } +static void +destroy_ (mix_device_t *dev) +{ + if (dev->type != mix_dev_CONSOLE && GET_FILE_(dev) != NULL) + mix_file_delete (GET_FILE_(dev)); +} + static mix_device_vtable_t VTABLE_ = { - write_, read_, ioc_, busy_ + write_, read_, ioc_, busy_, destroy_ }; const mix_device_vtable_t * DEF_DEV_VTABLE_ = &VTABLE_; -- cgit v1.2.3