# HG changeset patch # User iive # Date 1362848306 0 # Node ID bd190ad6b2041ca9d696cc5cea4acbc46b38ea65 # Parent 528e1429bfa2b009ae47fd83474c15b79d96d9ff Avoid calling FreeLibrary() twice. FreeLibrary() decreases a per-process reference/usage counter. This counter is set to 1 when a library is loaded at startup and increased with each LoadLibrary() call. Calling FreeLibrary() twice could unload the library (that is loaded at startup) and break code that calls its functions directly. In MPlayer this seems to happen with fontconfig package. diff -r 528e1429bfa2 -r bd190ad6b204 libdvdcss/libdvdcss.c --- a/libdvdcss/libdvdcss.c Tue Mar 05 13:38:39 2013 +0000 +++ b/libdvdcss/libdvdcss.c Sat Mar 09 16:58:26 2013 +0000 @@ -261,11 +261,7 @@ { /* Get the "Application Data" folder for the current user */ if( p_getpath( NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, - NULL, SHGFP_TYPE_CURRENT, psz_home ) == S_OK ) - { - FreeLibrary( p_dll ); - } - else + NULL, SHGFP_TYPE_CURRENT, psz_home ) != S_OK ) { *psz_home = '\0'; }