[matroska] r823 - trunk/DvdMenuXtractor/libdvdread/dvdread

[email protected]
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: robux4
Date: 2004-09-18 17:11:05 +0400 (Sat, 18 Sep 2004)
New Revision: 823

Modified:
   trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.c
   trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.h
   trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c
Log:
free allocated resources in libdvdread

Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.c
===================================================================
--- trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.c	2004-09-18 12:40:40 UTC (rev 822)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.c	2004-09-18 13:11:05 UTC (rev 823)
@@ -265,13 +265,13 @@
 typedef void *HMODULE;
 #endif
 
+static HMODULE dvdcss_library = NULL;
 
 /**
  * Setup read functions with either libdvdcss or minimal DVD access.
  */
 int dvdinput_setup(void)
 {
-  HMODULE dvdcss_library = NULL;
   char **dvdcss_version = NULL;
 
 #ifdef HAVE_DVDCSS_DVDCSS_H
@@ -357,3 +357,13 @@
     return 0;
   }
 }
+
+/*
+  clear the resources
+*/
+void dvdinput_unsetup()
+{
+	if (dvdcss_library)
+		dlclose(dvdcss_library);
+}
+

Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.h
===================================================================
--- trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.h	2004-09-18 12:40:40 UTC (rev 822)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.h	2004-09-18 13:11:05 UTC (rev 823)
@@ -43,5 +43,6 @@
  * Setup function accessed by dvd_reader.c.  Returns 1 if there is CSS support.
  */
 int dvdinput_setup(void);
+void dvdinput_unsetup(void);
 
 #endif /* DVD_INPUT_H_INCLUDED */

Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c
===================================================================
--- trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c	2004-09-18 12:40:40 UTC (rev 822)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c	2004-09-18 13:11:05 UTC (rev 823)
@@ -485,6 +485,7 @@
 	if( dvd->udfcache ) FreeUDFCache( dvd->udfcache );
         free( dvd );
     }
+	dvdinput_unsetup();
 }
 
 /**
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.