real fix for filesys double-free crash
This commit is contained in:
parent
1e7e1a03d7
commit
1fb59076ef
2 changed files with 10 additions and 7 deletions
|
@ -8647,11 +8647,7 @@ void filesys_cleanup(void)
|
||||||
filesys_free_handles();
|
filesys_free_handles();
|
||||||
free_mountinfo();
|
free_mountinfo();
|
||||||
destroy_comm_pipe(&shellexecute_pipe);
|
destroy_comm_pipe(&shellexecute_pipe);
|
||||||
if (singlethread_int_sem != nullptr)
|
uae_sem_destroy(&singlethread_int_sem);
|
||||||
{
|
|
||||||
uae_sem_destroy(&singlethread_int_sem);
|
|
||||||
singlethread_int_sem == nullptr;
|
|
||||||
}
|
|
||||||
shell_execute_data = 0;
|
shell_execute_data = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,17 @@ typedef SDL_sem* uae_sem_t;
|
||||||
STATIC_INLINE int uae_sem_init(uae_sem_t* sem, int dummy, int init)
|
STATIC_INLINE int uae_sem_init(uae_sem_t* sem, int dummy, int init)
|
||||||
{
|
{
|
||||||
*sem = SDL_CreateSemaphore(init);
|
*sem = SDL_CreateSemaphore(init);
|
||||||
return (*sem == nullptr);
|
return *sem == nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define uae_sem_destroy(PSEM) SDL_DestroySemaphore (*PSEM)
|
STATIC_INLINE void uae_sem_destroy(uae_sem_t* event)
|
||||||
|
{
|
||||||
|
if (*event)
|
||||||
|
{
|
||||||
|
SDL_DestroySemaphore(*event);
|
||||||
|
*event = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
#define uae_sem_post(PSEM) SDL_SemPost (*PSEM)
|
#define uae_sem_post(PSEM) SDL_SemPost (*PSEM)
|
||||||
#define uae_sem_wait(PSEM) SDL_SemWait (*PSEM)
|
#define uae_sem_wait(PSEM) SDL_SemWait (*PSEM)
|
||||||
#define uae_sem_trywait(PSEM) SDL_SemTryWait (*PSEM)
|
#define uae_sem_trywait(PSEM) SDL_SemTryWait (*PSEM)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue