Skip to content

Commit

Permalink
lib: Fix memory leak in parseScene()
Browse files Browse the repository at this point in the history
I didn't update this call site when I refactored
cr_scene_set_background() to not free the node that was passed in.
  • Loading branch information
vkoskiv committed Jan 8, 2024
1 parent b18ba99 commit 30395e3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/common/json_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ static void parseScene(struct cr_renderer *r, const cJSON *data) {

struct cr_shader_node *background = cr_shader_node_build(cJSON_GetObjectItem(data, "ambientColor"));
cr_scene_set_background(scene, background);
cr_shader_node_free(background);

parse_primitives(r, cJSON_GetObjectItem(data, "primitives"));
parse_meshes(r, cJSON_GetObjectItem(data, "meshes"));
Expand Down

0 comments on commit 30395e3

Please sign in to comment.