Commit 3a76a1bc authored by Claes Sjöfors's avatar Claes Sjöfors

Minor memory leak fixes

parent e32c20ea
......@@ -104,6 +104,8 @@ FlowCtx::~FlowCtx()
move_clear();
paste_clear();
delete_all();
if (scroll_data)
free(scroll_data);
for (int i = 0; i < a_nc.a_size; i++) {
element = a_nc.a[i];
......@@ -1633,32 +1635,25 @@ FlowArrayElem* FlowCtx::get_conclass_from_name(char* name)
void FlowCtx::remove_trace_objects()
{
int i;
FlowArrayElem *e;
for (i = 0; i < a.a_size; i++) {
if (a.a[i]->type() == flow_eObjectType_Node
&& ((FlowNode*)a.a[i])->nc->group == flow_eNodeGroup_Trace) {
remove(a.a[i]);
select_remove(a.a[i]);
move_remove(a.a[i]);
e = a.a[i];
remove(e);
select_remove(e);
move_remove(e);
delete e;
i--;
}
if (a.a[i]->type() == flow_eObjectType_Con
&& ((FlowCon*)a.a[i])->cc->group == flow_eConGroup_Trace) {
remove(a.a[i]);
select_remove(a.a[i]);
move_remove(a.a[i]);
i--;
}
}
for (i = 0; i < a_nc.a_size; i++) {
if (((FlowNodeClass*)a_nc.a[i])->group == flow_eNodeGroup_Trace) {
a_nc.remove(a_nc.a[i]);
i--;
}
}
for (i = 0; i < a_cc.a_size; i++) {
if (((FlowConClass*)a_cc.a[i])->group == flow_eConGroup_Trace) {
a_cc.remove(a_cc.a[i]);
e = a.a[i];
remove(e);
select_remove(e);
move_remove(e);
delete e;
i--;
}
}
......
......@@ -20640,6 +20640,14 @@ GePulldownMenu::GePulldownMenu(const GePulldownMenu& x)
}
}
GePulldownMenu::~GePulldownMenu()
{
for (int i = 0; i < 32; i++) {
if (items_dyn[i])
delete items_dyn[i];
}
}
void GePulldownMenu::get_attributes(attr_sItem* attrinfo, int* item_count)
{
int i = *item_count;
......
......@@ -2872,6 +2872,7 @@ public:
GePulldownMenu(GeDyn* e_dyn);
GePulldownMenu(const GePulldownMenu& x);
~GePulldownMenu();
void get_attributes(attr_sItem* attrinfo, int* item_count);
void save(std::ofstream& fp);
void open(std::ifstream& fp);
......
......@@ -909,7 +909,7 @@ void GlowCtx::paste_execute()
void GlowCtx::nav_zoom()
{
if (nodraw)
if (nodraw || no_nav)
return;
if (ctx_type == glow_eCtxType_Curve) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment