mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-22 15:11:31 +00:00
[client] overlay: clean up partial initialization
This commit is contained in:
@@ -60,6 +60,9 @@ static bool config_init(void ** udata, const void * params)
|
||||
|
||||
static void config_freeList(struct ll * list)
|
||||
{
|
||||
if (!list)
|
||||
return;
|
||||
|
||||
ConfigCallback * cb;
|
||||
while(ll_shift(list, (void **)&cb))
|
||||
{
|
||||
@@ -73,6 +76,8 @@ static void config_free(void * udata)
|
||||
{
|
||||
config_freeList(cfg.callbacks);
|
||||
config_freeList(cfg.tabCallbacks);
|
||||
cfg.callbacks = NULL;
|
||||
cfg.tabCallbacks = NULL;
|
||||
}
|
||||
|
||||
static void config_renderLGTab(void)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -75,10 +75,15 @@ static void freeMsg(struct Msg * msg)
|
||||
|
||||
static void msg_free(void * udata)
|
||||
{
|
||||
struct Msg * msg;
|
||||
while(ll_shift(l_msg.messages, (void **)&msg))
|
||||
freeMsg(msg);
|
||||
ll_free(l_msg.messages);
|
||||
if (l_msg.messages)
|
||||
{
|
||||
struct Msg * msg;
|
||||
while(ll_shift(l_msg.messages, (void **)&msg))
|
||||
freeMsg(msg);
|
||||
ll_free(l_msg.messages);
|
||||
l_msg.messages = NULL;
|
||||
}
|
||||
|
||||
l_msg.initialized = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ static bool splash_init(void ** udata, const void * params)
|
||||
static void splash_free(void * udata)
|
||||
{
|
||||
overlayFreeImage(&l_logo);
|
||||
stringlist_free(&l_tagline );
|
||||
stringlist_free(&l_tagline);
|
||||
stringlist_free(&l_footline);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user