Merge pull request #951 from heuripedes/master

Fix some memory issues
This commit is contained in:
Twinaphex 2014-09-06 20:53:34 +02:00
commit d303df6fa1
3 changed files with 13 additions and 5 deletions

View File

@ -208,6 +208,7 @@ void core_info_list_free(core_info_list_t *core_info_list)
core_info_t *info = (core_info_t*)&core_info_list->list[i];
free(info->path);
free(info->systemname);
free(info->display_name);
free(info->supported_extensions);
free(info->authors);

View File

@ -630,7 +630,7 @@ static void lakka_frame(void)
static GLuint png_texture_load(const char * file_name)
{
struct texture_image ti;
struct texture_image ti = {0};
texture_image_load(&ti, file_name);
/* Generate the OpenGL texture object */
@ -642,6 +642,8 @@ static GLuint png_texture_load(const char * file_name)
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
free(ti.pixels);
return texture;
}
@ -891,8 +893,9 @@ static void lakka_context_reset(void *data)
info = (core_info_t*)&info_list->list[i-1];
if (info != NULL && info->systemname) {
strlcpy(core_id, info->systemname, sizeof(core_id));
strlcpy(core_id, str_replace(core_id, "/", " "), sizeof(core_id));
char *tmp = str_replace(info->systemname, "/", " ");
strlcpy(core_id, tmp, sizeof(core_id));
free(tmp);
} else {
strlcpy(core_id, "default", sizeof(core_id));
}
@ -1021,6 +1024,10 @@ static void lakka_free(void *data)
if (menu->alloc_font)
free((uint8_t*)menu->font);
if (g_extern.core_info)
core_info_list_free(g_extern.core_info);
g_extern.core_info = NULL;
}
static int lakka_input_postprocess(uint64_t old_state)

View File

@ -53,7 +53,7 @@ typedef struct
typedef struct
{
char name[256];
char rom[256];
char rom[PATH_MAX];
float alpha;
float zoom;
float y;
@ -65,7 +65,7 @@ typedef struct
typedef struct
{
char name[256];
char libretro[256];
char libretro[PATH_MAX];
GLuint icon;
GLuint item_icon;
float alpha;