mirror of
https://github.com/izzy2lost/ppsspp.git
synced 2026-03-10 12:43:04 -07:00
virtfs: Tell file plugins which shut down.
We can have multiple, so it ideally needs to deal with the latest.
This commit is contained in:
@@ -831,7 +831,8 @@ void VirtualDiscFileSystem::HandlerLogger(void *arg, HandlerHandle handle, LogTy
|
||||
}
|
||||
}
|
||||
|
||||
VirtualDiscFileSystem::Handler::Handler(const char *filename, VirtualDiscFileSystem *const sys) {
|
||||
VirtualDiscFileSystem::Handler::Handler(const char *filename, VirtualDiscFileSystem *const sys)
|
||||
: sys_(sys) {
|
||||
#if !PPSSPP_PLATFORM(SWITCH)
|
||||
#ifdef _WIN32
|
||||
#if PPSSPP_PLATFORM(UWP)
|
||||
@@ -854,7 +855,12 @@ VirtualDiscFileSystem::Handler::Handler(const char *filename, VirtualDiscFileSys
|
||||
Read = (ReadFunc)dlsym(library, "Read");
|
||||
Close = (CloseFunc)dlsym(library, "Close");
|
||||
|
||||
if (Init == NULL || Shutdown == NULL || Open == NULL || Seek == NULL || Read == NULL || Close == NULL) {
|
||||
VersionFunc Version = VersionFunc();
|
||||
if (Version() >= 2) {
|
||||
ShutdownV2 = (ShutdownV2Func)Shutdown;
|
||||
}
|
||||
|
||||
if (!Init || !Shutdown || !Open || !Seek || !Read || !Close) {
|
||||
ERROR_LOG(FILESYS, "Unable to find all handler functions: %s", filename);
|
||||
dlclose(library);
|
||||
library = NULL;
|
||||
@@ -876,7 +882,10 @@ VirtualDiscFileSystem::Handler::Handler(const char *filename, VirtualDiscFileSys
|
||||
|
||||
VirtualDiscFileSystem::Handler::~Handler() {
|
||||
if (library != NULL) {
|
||||
Shutdown();
|
||||
if (ShutdownV2)
|
||||
ShutdownV2(sys_);
|
||||
else
|
||||
Shutdown();
|
||||
|
||||
#if !PPSSPP_PLATFORM(UWP) && !PPSSPP_PLATFORM(SWITCH)
|
||||
#ifdef _WIN32
|
||||
|
||||
Reference in New Issue
Block a user