LIBRETRO: add retroDestroy()

This commit is contained in:
Giovanni Cascione 2023-05-02 17:54:06 +02:00
parent 4f575b8078
commit 65aed42e7f
3 changed files with 11 additions and 1 deletions

View File

@ -94,4 +94,6 @@ void retroKeyEvent(bool down, unsigned keycode, uint32_t character, uint16_t key
uint8 getThreadSwitchCaller(void);
void retroDestroy(void);
#endif

View File

@ -1300,6 +1300,10 @@ public:
dynamic_cast<OSystem_RETRO *>(g_system)->getEventManager()->resetQuit();
}
void destroy() {
delete this;
}
};
OSystem *retroBuildOS() {
@ -1341,3 +1345,7 @@ void retroReset() {
uint8 getThreadSwitchCaller(){
return dynamic_cast<OSystem_RETRO *>(g_system)->getThreadSwitchCaller();
}
void retroDestroy() {
dynamic_cast<OSystem_RETRO *>(g_system)->destroy();
}

View File

@ -568,7 +568,7 @@ void retro_init(void) {
}
void retro_deinit(void) {
g_system->destroy();
retroDestroy();
free(sound_buffer);
}