mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-27 22:43:36 +00:00
fix a memory leak in new_fluid_thread()
This commit is contained in:
parent
8f3af98a94
commit
89ffe5881d
1 changed files with 5 additions and 9 deletions
|
@ -945,7 +945,7 @@ fluid_thread_t *
|
|||
new_fluid_thread(const char *name, fluid_thread_func_t func, void *data, int prio_level, int detach)
|
||||
{
|
||||
GThread *thread;
|
||||
fluid_thread_info_t *info;
|
||||
fluid_thread_info_t *info = NULL;
|
||||
GError *err = NULL;
|
||||
|
||||
g_return_val_if_fail(func != NULL, NULL);
|
||||
|
@ -982,25 +982,21 @@ new_fluid_thread(const char *name, fluid_thread_func_t func, void *data, int pri
|
|||
#endif
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
#if NEW_GLIB_THREAD_API
|
||||
else
|
||||
{
|
||||
thread = g_thread_try_new(name, (GThreadFunc)func, data, &err);
|
||||
}
|
||||
|
||||
#else
|
||||
else
|
||||
{
|
||||
thread = g_thread_create((GThreadFunc)func, data, detach == FALSE, &err);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
if(!thread)
|
||||
{
|
||||
FLUID_LOG(FLUID_ERR, "Failed to create the thread: %s",
|
||||
fluid_gerror_message(err));
|
||||
g_clear_error(&err);
|
||||
FLUID_FREE(info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue