Wasn't nulling correctly. Eject test faulty too.

This commit is contained in:
rocky
2003-05-16 07:36:48 +00:00
parent 8b22196efe
commit 29d1f1da90

View File

@@ -1,5 +1,5 @@
/* /*
$Id: cdio.c,v 1.12 2003/05/16 07:18:27 rocky Exp $ $Id: cdio.c,v 1.13 2003/05/16 07:36:48 rocky Exp $
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
@@ -35,7 +35,7 @@
#include <cdio/logging.h> #include <cdio/logging.h>
#include "cdio_private.h" #include "cdio_private.h"
static const char _rcsid[] = "$Id: cdio.c,v 1.12 2003/05/16 07:18:27 rocky Exp $"; static const char _rcsid[] = "$Id: cdio.c,v 1.13 2003/05/16 07:36:48 rocky Exp $";
const char *track_format2str[5] = const char *track_format2str[5] =
@@ -141,18 +141,18 @@ int
cdio_eject_media (CdIo **obj) cdio_eject_media (CdIo **obj)
{ {
if ((obj == NULL) || (*obj != NULL)) return 1; if ((obj == NULL) || (*obj == NULL)) return 1;
if ((*obj)->op.eject_media) { if ((*obj)->op.eject_media) {
int ret = (*obj)->op.eject_media ((*obj)->user_data); int ret = (*obj)->op.eject_media ((*obj)->user_data);
if (0 == ret) { if (0 == ret) {
cdio_destroy(*obj); cdio_destroy(*obj);
obj = NULL; *obj = NULL;
} }
return ret; return ret;
} else { } else {
cdio_destroy(*obj); cdio_destroy(*obj);
obj = NULL; *obj = NULL;
return 2; return 2;
} }
} }