[vlc-commits] activex: first stop playing, only then destroy plugin parts.

Sergey Radionov git at videolan.org
Wed Jul 4 11:12:21 CEST 2012


npapi-vlc | branch: master | Sergey Radionov <rsatom at gmail.com> | Fri Jun 29 21:22:34 2012 +0700| [0eb6bdadbfe8ea42e8561f98427b57cd830e3c5d] | committer: Rafaël Carré

activex: first stop playing, only then destroy plugin parts.

fix crash on closing some host applications when media still playing.

Signed-off-by: Rafaël Carré <funman at videolan.org>

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=0eb6bdadbfe8ea42e8561f98427b57cd830e3c5d
---

 activex/plugin.cpp |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/activex/plugin.cpp b/activex/plugin.cpp
index fe5c5b8..17ac732 100644
--- a/activex/plugin.cpp
+++ b/activex/plugin.cpp
@@ -282,6 +282,14 @@ VLCPlugin::VLCPlugin(VLCPluginClass *p_class, LPUNKNOWN pUnkOuter) :
 
 VLCPlugin::~VLCPlugin()
 {
+    if( vlc_player::is_open() )
+    {
+        if( isPlaying() )
+            playlist_stop();
+
+        player_unregister_events();
+    }
+
     delete vlcSupportErrorInfo;
     delete vlcOleObject;
     delete vlcDataObject;
@@ -304,14 +312,6 @@ VLCPlugin::~VLCPlugin()
     SysFreeString(_bstr_mrl);
     SysFreeString(_bstr_baseurl);
 
-    if( vlc_player::is_open() )
-    {
-        if( isPlaying() )
-            playlist_stop();
-
-        player_unregister_events();
-    }
-
     if( _p_libvlc )  { libvlc_release(_p_libvlc); _p_libvlc=NULL; }
 
     _p_class->Release();



More information about the vlc-commits mailing list