diff options
author | Reinhard Nißl <rnissl@gmx.de> | 2008-03-11 22:21:15 +0100 |
---|---|---|
committer | Reinhard Nißl <rnissl@gmx.de> | 2008-03-11 22:21:15 +0100 |
commit | 8405a6c9ce882f09c11963fcc0fbc2dcbac57c4f (patch) | |
tree | 696f8db46daca3c32eba5d6ac5ba9879a3cc1410 | |
parent | 6e14bdb6a55f5136fa0e99b2b9b621647fc7d432 (diff) | |
download | xine-lib-8405a6c9ce882f09c11963fcc0fbc2dcbac57c4f.tar.gz xine-lib-8405a6c9ce882f09c11963fcc0fbc2dcbac57c4f.tar.bz2 |
Fix accessing plugin node after disposing plugin in plugin free functions.
-rw-r--r-- | src/xine-engine/load_plugins.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 46535ef33..710e6dfbf 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -1339,11 +1339,13 @@ input_plugin_t *_x_find_input_plugin (xine_stream_t *stream, const char *mrl) { void _x_free_input_plugin (xine_stream_t *stream, input_plugin_t *input) { plugin_catalog_t *catalog = stream->xine->plugin_catalog; + plugin_node_t *node = input->node; input->dispose(input); - if (input->node) { + + if (node) { pthread_mutex_lock(&catalog->lock); - dec_node_ref(input->node); + dec_node_ref(node); pthread_mutex_unlock(&catalog->lock); } } @@ -1560,11 +1562,13 @@ demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const cha void _x_free_demux_plugin (xine_stream_t *stream, demux_plugin_t *demux) { plugin_catalog_t *catalog = stream->xine->plugin_catalog; + plugin_node_t *node = demux->node; demux->dispose(demux); - if (demux->node) { + + if (node) { pthread_mutex_lock(&catalog->lock); - dec_node_ref(demux->node); + dec_node_ref(node); pthread_mutex_unlock(&catalog->lock); } } @@ -2054,12 +2058,13 @@ video_decoder_t *_x_get_video_decoder (xine_stream_t *stream, uint8_t stream_typ void _x_free_video_decoder (xine_stream_t *stream, video_decoder_t *vd) { plugin_catalog_t *catalog = stream->xine->plugin_catalog; + plugin_node_t *node = vd->node; vd->dispose (vd); - if (vd->node) { + if (node) { pthread_mutex_lock (&catalog->lock); - dec_node_ref(vd->node); + dec_node_ref(node); pthread_mutex_unlock (&catalog->lock); } } |