[client] overlay: clean up partial initialization

This commit is contained in:
Geoffrey McRae
2026-08-12 02:57:42 +10:00
parent 6ddf1d62cd
commit ebc9d076ec
7 changed files with 40 additions and 21 deletions

View File

@@ -168,16 +168,26 @@ static bool graphs_init(void ** udata, const void * params)
static void graphs_free(void * udata)
{
struct OverlayGraph * graph;
while(ll_shift(gs.graphs, (void **)&graph))
graphFree(graph);
ll_free(gs.graphs);
gs.graphs = NULL;
if (gs.graphs)
{
struct OverlayGraph * graph;
while(ll_shift(gs.graphs, (void **)&graph))
graphFree(graph);
ll_free(gs.graphs);
gs.graphs = NULL;
}
ImPlotSpec_destroy(gs.plotSpec);
gs.plotSpec = NULL;
ImPlot_DestroyContext(gs.plotContext);
gs.plotContext = NULL;
if (gs.plotSpec)
{
ImPlotSpec_destroy(gs.plotSpec);
gs.plotSpec = NULL;
}
if (gs.plotContext)
{
ImPlot_DestroyContext(gs.plotContext);
gs.plotContext = NULL;
}
}
struct BufferMetrics