From c2247a35e97c96eba9cd4caf09b32b038625cc31 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Tue, 31 Jan 2023 21:45:23 -0500 Subject: Clean up possible early deletion issues in API callbacks --- flowgraph.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'flowgraph.cpp') diff --git a/flowgraph.cpp b/flowgraph.cpp index b812e57d..66e8eb7f 100644 --- a/flowgraph.cpp +++ b/flowgraph.cpp @@ -94,28 +94,28 @@ FlowGraph::FlowGraph(BNFlowGraph* graph) void FlowGraph::PrepareForLayoutCallback(void* ctxt) { - FlowGraph* graph = (FlowGraph*)ctxt; + CallbackRef graph(ctxt); graph->PrepareForLayout(); } void FlowGraph::PopulateNodesCallback(void* ctxt) { - FlowGraph* graph = (FlowGraph*)ctxt; + CallbackRef graph(ctxt); graph->PopulateNodes(); } void FlowGraph::CompleteLayoutCallback(void* ctxt) { - FlowGraph* graph = (FlowGraph*)ctxt; + CallbackRef graph(ctxt); graph->CompleteLayout(); } BNFlowGraph* FlowGraph::UpdateCallback(void* ctxt) { - FlowGraph* graph = (FlowGraph*)ctxt; + CallbackRef graph(ctxt); Ref result = graph->Update(); if (!result) return nullptr; -- cgit v1.3.1