[libbluray-devel] Move bdj storage cleanup to bdj.c

hpi1 git at videolan.org
Fri Dec 1 10:49:18 CET 2017


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Oct 20 23:14:19 2017 +0300| [875461efbaf92c1f44b9f587199486e2e7c4a48d] | committer: hpi1

Move bdj storage cleanup to bdj.c

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=875461efbaf92c1f44b9f587199486e2e7c4a48d
---

 src/libbluray/bdj/bdj.c | 7 +++++++
 src/libbluray/bdj/bdj.h | 2 ++
 src/libbluray/bluray.c  | 9 +--------
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index e1e2c53c..511ad533 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -466,6 +466,13 @@ static int _can_read_file(const char *fn)
     return 0;
 }
 
+void bdj_storage_cleanup(BDJ_STORAGE *p)
+{
+    X_FREE(p->cache_root);
+    X_FREE(p->persistent_root);
+    X_FREE(p->classpath);
+}
+
 static const char *_find_libbluray_jar(BDJ_STORAGE *storage)
 {
     // pre-defined search paths for libbluray.jar
diff --git a/src/libbluray/bdj/bdj.h b/src/libbluray/bdj/bdj.h
index 789e7fee..3dcdb86d 100644
--- a/src/libbluray/bdj/bdj.h
+++ b/src/libbluray/bdj/bdj.h
@@ -82,4 +82,6 @@ BD_PRIVATE int  bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param);
 
 BD_PRIVATE int  bdj_jvm_available(BDJ_STORAGE *storage); /* 0: no. 1: only jvm. 2: jvm + libbluray.jar. */
 
+BD_PRIVATE void bdj_storage_cleanup(BDJ_STORAGE *);
+
 #endif
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 9d89feed..883b35ce 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -1376,13 +1376,6 @@ static void _close_bdj(BLURAY *bd)
     }
 }
 
-static void _storage_free(BLURAY *bd)
-{
-    X_FREE(bd->bdjstorage.cache_root);
-    X_FREE(bd->bdjstorage.persistent_root);
-    X_FREE(bd->bdjstorage.classpath);
-}
-
 /*
  * open / close
  */
@@ -1524,7 +1517,7 @@ void bd_close(BLURAY *bd)
 
     event_queue_destroy(&bd->event_queue);
     array_free((void**)&bd->titles);
-    _storage_free(bd);
+    bdj_storage_cleanup(&bd->bdjstorage);
 
     disc_close(&bd->disc);
 



More information about the libbluray-devel mailing list