Mercurial > hg > xmms-sid
diff src/xmms-sid.c @ 794:3012740d014c
Add some NULL pointer checks in case the emulator engine backend didn't
initialize and the user tries to play things anyway.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 07 Nov 2012 11:04:34 +0200 |
parents | 8f0d11865742 |
children | 02512cbc6d9f |
line wrap: on
line diff
--- a/src/xmms-sid.c Wed Nov 07 10:54:43 2012 +0200 +++ b/src/xmms-sid.c Wed Nov 07 11:04:34 2012 +0200 @@ -216,8 +216,11 @@ xs_tuneinfo_free(xs_status.tuneInfo); xs_status.tuneInfo = NULL; - xs_status.engine->plrDeleteSID(&xs_status); - xs_status.engine->plrClose(&xs_status); + if (xs_status.engine != NULL) + { + xs_status.engine->plrDeleteSID(&xs_status); + xs_status.engine->plrClose(&xs_status); + } xs_songlen_close(); xs_stil_close(); @@ -583,7 +586,9 @@ /* Free tune information */ XS_MUTEX_LOCK(xs_status); - xs_status.engine->plrDeleteSID(&xs_status); + if (xs_status.engine != NULL) + xs_status.engine->plrDeleteSID(&xs_status); + xs_tuneinfo_free(xs_status.tuneInfo); xs_status.tuneInfo = NULL; XS_MUTEX_UNLOCK(xs_status); @@ -881,6 +886,9 @@ { XSTuneInfo *info; + if (xs_status.engine == NULL) + return; + XS_MUTEX_LOCK(xs_status); /* Get tune information from emulation engine */