summaryrefslogtreecommitdiffhomepage
path: root/mixlib/xmix_device.c
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2001-05-07 23:02:25 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2001-05-07 23:02:25 +0000
commit867d234efdc7d557d0e1dd8a6104dfcf5a01083c (patch)
tree7f7b6e3778b9acee934fd52bfac9a4311befc216 /mixlib/xmix_device.c
parentfd196852447f1a67e4d94900689a27e39fa86f0f (diff)
downloadmdk-867d234efdc7d557d0e1dd8a6104dfcf5a01083c.tar.gz
mdk-867d234efdc7d557d0e1dd8a6104dfcf5a01083c.tar.bz2
mix_device_t: virtual destructor added
Diffstat (limited to 'mixlib/xmix_device.c')
-rw-r--r--mixlib/xmix_device.c11
1 files changed, 9 insertions, 2 deletions
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_;