-
I can't seem to find a good way of doing this, so I thought I'd ask here. In my little test app I want to see if a if (!reverb.baseNode.pNodeGraph) {
auto config = ma_reverb_node_config_init(2, 44100);
config.roomSize = 100.0;
auto* node_graph = ma_engine_get_node_graph(&engine);
if (const auto res = ma_reverb_node_init(node_graph, &config, nullptr, &reverb); res != MA_SUCCESS) {
MessageBox(NULL, std::format("Error initializing MA reverb node: {}", res).c_str(), "Error", MB_OK | MB_ICONSTOP);
PostQuitMessage(0);
}
ma_node_attach_output_bus(&reverb, 0, ma_node_graph_get_endpoint(node_graph), 0);
} else {
ma_reverb_node_uninit(&reverb, nullptr);
} However, The MSVC CRT really doesn't like this and complains about a debug heap free (perhaps a use-after-free or double free). Is there a more robust or "blessed"/recommended way of determining if a node has already been configured and set up? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You yourself initialize and uninitialize the node, so that must mean that your program already knows when it's initialized. |
Beta Was this translation helpful? Give feedback.
-
Ah okay, thanks :) |
Beta Was this translation helpful? Give feedback.
You yourself initialize and uninitialize the node, so that must mean that your program already knows when it's initialized.