mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Bunch of tiny memory leaks fixed and cleanup, フウ〜!
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5056 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -407,7 +407,7 @@ char **cdio_get_devices() {
|
||||
#elif __linux__
|
||||
return cdio_get_devices_linux();
|
||||
#else
|
||||
// todo add somewarning
|
||||
#warning CDIO not supported on your platform!
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -416,7 +416,14 @@ void SleepCurrentThread(int ms)
|
||||
|
||||
void SetCurrentThreadName(const TCHAR* szThreadName)
|
||||
{
|
||||
pthread_setspecific(threadname_key, strdup(szThreadName));
|
||||
char *name = strdup(szThreadName);
|
||||
// pthread_setspecific returns 0 on success
|
||||
// free the string from strdup if fails
|
||||
// creates a memory leak if it actually doesn't fail
|
||||
// since we don't delete it once we delete the thread
|
||||
// we are using a single threadname_key anyway for all threads
|
||||
if(!pthread_setspecific(threadname_key, strdup(szThreadName)))
|
||||
free(name);
|
||||
INFO_LOG(COMMON, "%s(%s)\n", __FUNCTION__, szThreadName);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user