1
0
Fork 0

Move bdj storage cleanup to bdj.c

This commit is contained in:
hpi1 2017-10-20 23:14:19 +03:00
parent 1ecdedf17c
commit 875461efba
3 changed files with 10 additions and 8 deletions

View 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

View 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

View 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);