cwFlowNet.cpp : Fixed bug where poly nets UI elements were not released.

Added and set ui_var_t.has_source_fl.
This commit is contained in:
kevin 2024-10-19 12:37:13 -04:00
parent 11489d89b4
commit 930982028d
2 changed files with 16 additions and 6 deletions

View File

@ -102,7 +102,7 @@ namespace cw
typedef struct ui_proc_desc_str
{
const char* label;
const char* label; // class label
ui_preset_t* presetA; // presetA[ presetN ]
unsigned presetN;
} ui_proc_desc_t;
@ -111,7 +111,7 @@ namespace cw
typedef struct ui_var_str
{
struct ui_proc_str* ui_proc;
struct ui_proc_str* ui_proc; // owning proc
const char* label; // flow::variable_t::label
unsigned label_sfx_id; // flow::variable_t::label_sfx_id
@ -119,6 +119,7 @@ namespace cw
const object_t* desc_cfg; // var desc cfg from flow::var_desc_t
unsigned desc_flags; // flow::var_desc_t::flags
bool has_source_fl; // true if this var is connected to a source var
unsigned value_tid; // flow::variable_t::type
unsigned vid; // flow::variable_t::vid
unsigned ch_idx; // flow::variable_t::chIdx

View File

@ -132,12 +132,20 @@ namespace cw
for(unsigned i=0; i<ui_net->procN; ++i)
{
mem::release(ui_net->procA[i].varA);
ui_net_t* iun = ui_net->procA[i].internal_net;
while( iun!=nullptr )
{
ui_net_t* iun0 = iun->poly_link;
_destroy_ui_net(iun);
iun = iun0;
}
mem::release(ui_net->procA[i].varA);
}
mem::release(ui_net->procA);
mem::release(ui_net->presetA);
mem::release(ui_net);
return rc;
}
@ -3110,6 +3118,7 @@ namespace cw
ui_var->ui_proc = ui_proc;
ui_var->label = var->label;
ui_var->label_sfx_id = var->label_sfx_id;
ui_var->has_source_fl= is_connected_to_source( var );
ui_var->vid = var->vid;
ui_var->ch_cnt = var_channel_count( net.procA[i], var->label, var->label_sfx_id );
ui_var->ch_idx = var->chIdx;