diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2004-08-19 10:30:04 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2004-08-19 10:30:04 +0000 |
commit | 724fd02cf7045775dc380e375a6c5f90047b2115 (patch) | |
tree | f2fe9b7538e1b866094e052476494db342066158 | |
parent | 54948a616be9daaa2b28b38ae7355f00e46e796d (diff) | |
download | xine-lib-724fd02cf7045775dc380e375a6c5f90047b2115.tar.gz xine-lib-724fd02cf7045775dc380e375a6c5f90047b2115.tar.bz2 |
* 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
-rw-r--r-- | src/input/input_dvd.c | 11 |
1 files 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); |