(task_screenshot.c) Prevent memory leak
This commit is contained in:
parent
1b3b0c26d1
commit
0d1fcbbe1e
|
@ -86,7 +86,6 @@ typedef struct
|
||||||
static void task_screenshot_handler(retro_task_t *task)
|
static void task_screenshot_handler(retro_task_t *task)
|
||||||
{
|
{
|
||||||
screenshot_task_state_t *state = (screenshot_task_state_t*)task->state;
|
screenshot_task_state_t *state = (screenshot_task_state_t*)task->state;
|
||||||
char *msg = NULL;
|
|
||||||
bool is_paused = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL);
|
bool is_paused = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL);
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
|
@ -164,8 +163,9 @@ static void task_screenshot_handler(retro_task_t *task)
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
msg = strdup(msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT));
|
char *msg = strdup(msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT));
|
||||||
runloop_msg_queue_push(msg, 1, is_paused ? 1 : 180, true);
|
runloop_msg_queue_push(msg, 1, is_paused ? 1 : 180, true);
|
||||||
|
free(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue