Move bdj storage cleanup to bdj.c
authorhpi1 <hpi1@anonymous.org>
Fri, 20 Oct 2017 20:14:19 +0000 (23:14 +0300)
committerhpi1 <hpi1@anonymous.org>
Fri, 20 Oct 2017 20:14:19 +0000 (23:14 +0300)
src/libbluray/bdj/bdj.c
src/libbluray/bdj/bdj.h
src/libbluray/bluray.c

index e1e2c53..511ad53 100644 (file)
@@ -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
index 789e7fe..3dcdb86 100644 (file)
@@ -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
index 9d89fee..883b35c 100644 (file)
@@ -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);