Skip to content

Commit

Permalink
Fix crash due to missing (NULL) renderer driver
Browse files Browse the repository at this point in the history
Free texture before freeing the renderer. Free the renderer first will
lead to a crash because freeing the texture object involved the renderer
driver.
  • Loading branch information
lundmar committed Jan 27, 2022
1 parent d3900a5 commit 89aa043
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gtkchart.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,11 +831,11 @@ bool gtk_chart_save_image(GtkChart *chart, const char *filename)
gdk_texture_save_to_png (texture, filename);

// Cleanup
g_object_unref(paintable);
g_object_unref(snapshot);
gsk_render_node_unref(node);
g_object_unref(renderer);
g_object_unref(texture);
g_object_unref(renderer);
gsk_render_node_unref(node);
g_object_unref(snapshot);
g_object_unref(paintable);

return true;
}

0 comments on commit 89aa043

Please sign in to comment.