mirror of
https://github.com/libretro/RetroArch
synced 2025-02-11 15:40:28 +00:00
Prevent some more memsets
This commit is contained in:
parent
0ef96ddbbc
commit
cb772047ff
@ -220,7 +220,9 @@ void image_texture_free(struct texture_image *img)
|
|||||||
|
|
||||||
if (img->pixels)
|
if (img->pixels)
|
||||||
free(img->pixels);
|
free(img->pixels);
|
||||||
memset(img, 0, sizeof(*img));
|
img->width = 0;
|
||||||
|
img->height = 0;
|
||||||
|
img->pixels = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum video_image_format image_texture_get_type(const char *path)
|
static enum video_image_format image_texture_get_type(const char *path)
|
||||||
|
@ -723,17 +723,10 @@ void menu_display_snow(int width, int height)
|
|||||||
float alpha;
|
float alpha;
|
||||||
bool alive;
|
bool alive;
|
||||||
};
|
};
|
||||||
static struct display_particle particles[PARTICLES_COUNT];
|
static struct display_particle particles[PARTICLES_COUNT] = {0};
|
||||||
static bool initialized = false;
|
|
||||||
static int timeout = 0;
|
static int timeout = 0;
|
||||||
unsigned i, max_gen = 2;
|
unsigned i, max_gen = 2;
|
||||||
|
|
||||||
if (!initialized)
|
|
||||||
{
|
|
||||||
memset(particles, 0, sizeof(particles));
|
|
||||||
initialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < PARTICLES_COUNT; ++i)
|
for (i = 0; i < PARTICLES_COUNT; ++i)
|
||||||
{
|
{
|
||||||
struct display_particle *p = (struct display_particle*)&particles[i];
|
struct display_particle *p = (struct display_particle*)&particles[i];
|
||||||
|
13
playlist.c
13
playlist.c
@ -152,29 +152,28 @@ static void playlist_free_entry(struct playlist_entry *entry)
|
|||||||
|
|
||||||
if (entry->path)
|
if (entry->path)
|
||||||
free(entry->path);
|
free(entry->path);
|
||||||
entry->path = NULL;
|
|
||||||
|
|
||||||
if (entry->label)
|
if (entry->label)
|
||||||
free(entry->label);
|
free(entry->label);
|
||||||
entry->label = NULL;
|
|
||||||
|
|
||||||
if (entry->core_path)
|
if (entry->core_path)
|
||||||
free(entry->core_path);
|
free(entry->core_path);
|
||||||
entry->core_path = NULL;
|
|
||||||
|
|
||||||
if (entry->core_name)
|
if (entry->core_name)
|
||||||
free(entry->core_name);
|
free(entry->core_name);
|
||||||
entry->core_name = NULL;
|
|
||||||
|
|
||||||
if (entry->db_name)
|
if (entry->db_name)
|
||||||
free(entry->db_name);
|
free(entry->db_name);
|
||||||
entry->core_name = NULL;
|
|
||||||
|
|
||||||
if (entry->crc32)
|
if (entry->crc32)
|
||||||
free(entry->crc32);
|
free(entry->crc32);
|
||||||
entry->crc32 = NULL;
|
|
||||||
|
|
||||||
memset(entry, 0, sizeof(*entry));
|
entry->path = NULL;
|
||||||
|
entry->label = NULL;
|
||||||
|
entry->core_path = NULL;
|
||||||
|
entry->core_name = NULL;
|
||||||
|
entry->db_name = NULL;
|
||||||
|
entry->crc32 = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void playlist_update(playlist_t *playlist, size_t idx,
|
void playlist_update(playlist_t *playlist, size_t idx,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user