Fix multiple memory leaks found with LeakSanitizer.
parent
fbe2705ebe
commit
8bf55b3c62
|
@ -389,6 +389,8 @@ void GraphicsWindow::HitTestMakeSelection(Point2d mp) {
|
|||
}
|
||||
}
|
||||
|
||||
canvas.Clear();
|
||||
|
||||
if(!s.Equals(&hover)) {
|
||||
hover = s;
|
||||
PaintGraphics();
|
||||
|
@ -787,5 +789,6 @@ void GraphicsWindow::Paint() {
|
|||
}
|
||||
|
||||
canvas.EndFrame();
|
||||
canvas.Clear();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1187,19 +1187,21 @@ void Constraint::Draw(DrawAs how, Canvas *canvas) {
|
|||
}
|
||||
|
||||
Vector Constraint::GetLabelPos(const Camera &camera) {
|
||||
Vector p;
|
||||
|
||||
ObjectPicker canvas = {};
|
||||
canvas.camera = camera;
|
||||
|
||||
Vector p;
|
||||
DoLayout(DrawAs::DEFAULT, &canvas, &p, NULL);
|
||||
canvas.Clear();
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
void Constraint::GetReferencePoints(const Camera &camera, std::vector<Vector> *refs) {
|
||||
ObjectPicker canvas = {};
|
||||
canvas.camera = camera;
|
||||
|
||||
DoLayout(DrawAs::DEFAULT, &canvas, NULL, refs);
|
||||
canvas.Clear();
|
||||
}
|
||||
|
||||
bool Constraint::IsStylable() const {
|
||||
|
|
|
@ -126,14 +126,17 @@ void Entity::GetReferencePoints(std::vector<Vector> *refs) {
|
|||
}
|
||||
|
||||
int Entity::GetPositionOfPoint(const Camera &camera, Point2d p) {
|
||||
int position;
|
||||
|
||||
ObjectPicker canvas = {};
|
||||
canvas.camera = camera;
|
||||
canvas.point = p;
|
||||
canvas.minDistance = 1e12;
|
||||
|
||||
Draw(DrawAs::DEFAULT, &canvas);
|
||||
position = canvas.position;
|
||||
canvas.Clear();
|
||||
|
||||
return canvas.position;
|
||||
return position;
|
||||
}
|
||||
|
||||
bool Entity::IsStylable() const {
|
||||
|
|
|
@ -220,6 +220,8 @@ void SolveSpaceUI::ExportViewOrWireframeTo(const std::string &filename, bool exp
|
|||
for(Constraint &c : SK.constraint) {
|
||||
c.Draw(Constraint::DrawAs::DEFAULT, &canvas);
|
||||
}
|
||||
|
||||
canvas.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -858,6 +858,7 @@ void TextWindow::Paint() {
|
|||
DrawOrHitTestColorPicker(&uiCanvas, PAINT, false, 0, 0);
|
||||
|
||||
canvas.EndFrame();
|
||||
canvas.Clear();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue