mirror of
https://github.com/jhasse/poly2tri.git
synced 2024-11-26 15:26:12 +01:00
fixed none memory leaks...
This commit is contained in:
parent
8b0b7e3c79
commit
1bdb0893cd
@ -32,6 +32,7 @@
|
||||
#include "sweep_context.h"
|
||||
#include "advancing_front.h"
|
||||
#include "../common/utils.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace p2t {
|
||||
|
||||
@ -527,6 +528,7 @@ void Sweep::FillBasinReq(SweepContext& tcx, Node* node)
|
||||
}
|
||||
|
||||
Fill(tcx, *node);
|
||||
Node *temp = node;
|
||||
|
||||
if (node->prev == tcx.basin.left_node && node->next == tcx.basin.right_node) {
|
||||
delete node;
|
||||
@ -537,31 +539,24 @@ void Sweep::FillBasinReq(SweepContext& tcx, Node* node)
|
||||
delete node;
|
||||
return;
|
||||
}
|
||||
Node *temp = node;
|
||||
node = node->next;
|
||||
delete temp;
|
||||
} else if (node->next == tcx.basin.right_node) {
|
||||
Orientation o = Orient2d(*node->point, *node->prev->point, *node->prev->prev->point);
|
||||
if (o == CCW) {
|
||||
delete node;
|
||||
return;
|
||||
}
|
||||
Node *temp = node;
|
||||
node = node->prev;
|
||||
delete temp;
|
||||
} else {
|
||||
// Continue with the neighbor node with lowest Y value
|
||||
if (node->prev->point->y < node->next->point->y) {
|
||||
Node *temp = node;
|
||||
node = node->prev;
|
||||
delete temp;
|
||||
} else {
|
||||
Node *temp = node;
|
||||
node = node->next;
|
||||
delete temp;
|
||||
}
|
||||
}
|
||||
|
||||
delete temp;
|
||||
FillBasinReq(tcx, node);
|
||||
}
|
||||
|
||||
@ -633,6 +628,9 @@ void Sweep::FillRightConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delete &node.next;
|
||||
|
||||
}
|
||||
|
||||
void Sweep::FillRightConvexEdgeEvent(SweepContext& tcx, Edge* edge, Node& node)
|
||||
@ -714,6 +712,8 @@ void Sweep::FillLeftConcaveEdgeEvent(SweepContext& tcx, Edge* edge, Node& node)
|
||||
}
|
||||
}
|
||||
|
||||
delete &node.prev;
|
||||
|
||||
}
|
||||
|
||||
void Sweep::FlipEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* t, Point& p)
|
||||
|
Loading…
Reference in New Issue
Block a user