--- branches/release-1_0-branch/xvidcore/vfw/src/driverproc.c 2004/04/02 22:20:31 1399 +++ branches/release-1_0-branch/xvidcore/vfw/src/driverproc.c 2004/04/02 23:59:24 1400 @@ -19,7 +19,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: driverproc.c,v 1.2.2.1 2004-03-31 19:35:31 edgomez Exp $ + * $Id: driverproc.c,v 1.2.2.2 2004-04-02 23:59:24 edgomez Exp $ * ****************************************************************************/ @@ -33,6 +33,7 @@ #include "status.h" #include "resource.h" +static int clean_dll_bindings(CODEC* codec); BOOL WINAPI DllMain( HANDLE hModule, @@ -112,6 +113,7 @@ /* compress_end/decompress_end don't always get called */ compress_end(codec); decompress_end(codec); + clean_dll_bindings(codec); status_destroy_always(&codec->status); free(codec); return DRV_OK; @@ -295,7 +297,6 @@ } } - void WINAPI Configure(HWND hwnd, HINSTANCE hinst, LPTSTR lpCmdLine, int nCmdShow) { DWORD dwDriverId; @@ -307,3 +308,21 @@ DriverProc(dwDriverId, 0, DRV_CLOSE, 0, 0); } } + +static int clean_dll_bindings(CODEC* codec) +{ + if(codec->m_hdll) + { + FreeLibrary(codec->m_hdll); + codec->m_hdll = NULL; + codec->xvid_global_func = NULL; + codec->xvid_encore_func = NULL; + codec->xvid_decore_func = NULL; + codec->xvid_plugin_single_func = NULL; + codec->xvid_plugin_2pass1_func = NULL; + codec->xvid_plugin_2pass2_func = NULL; + codec->xvid_plugin_lumimasking_func = NULL; + codec->xvid_plugin_psnr_func = NULL; + } + return 0; +}