From 724fd02cf7045775dc380e375a6c5f90047b2115 Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Thu, 19 Aug 2004 10:30:04 +0000 Subject: * set the instance pointer to NULL before closing the dvdnav handle (fixes crashes when changing the default language) * fix a race that can lead to a memleak CVS patchset: 6897 CVS date: 2004/08/19 10:30:04 --- src/input/input_dvd.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index 881466549..e20d1c21b 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: input_dvd.c,v 1.186 2004/08/01 16:18:43 mroi Exp $ + * $Id: input_dvd.c,v 1.187 2004/08/19 10:30:04 mroi Exp $ * */ @@ -408,12 +408,17 @@ static void dvd_plugin_dispose (input_plugin_t *this_gen) { if (this->event_queue) xine_event_dispose_queue (this->event_queue); - if (this->dvdnav) { - dvdnav_close(this->dvdnav); + ((dvd_input_class_t *)this_gen->input_class)->ip = NULL; + dvdnav_close(this->dvdnav); + + pthread_mutex_lock(&this->buf_mutex); + if (this->mem_stack) { /* raise the freeing flag, so that the plugin will be freed as soon * as all buffers have returned to the libdvdnav read ahead cache */ this->freeing = 1; + pthread_mutex_unlock(&this->buf_mutex); } else { + pthread_mutex_unlock(&this->buf_mutex); pthread_mutex_destroy(&this->buf_mutex); free(this->mem); free(this); -- cgit v1.2.3