Skip to content
Permalink
Browse files

Fix segfault with selection

  • Loading branch information...
feragon committed Jul 6, 2016
1 parent 01d7996 commit f0d5dc5c48412db167b785d03d7c9eccc48f3b59
Showing with 3 additions and 0 deletions.
  1. +3 −0 lcviewernoqt/documentcanvas.cpp
@@ -88,6 +88,7 @@ DocumentCanvas::~DocumentCanvas() {

if (_selectedArea != nullptr) {
delete _selectedArea;
_selectedArea = nullptr;
}
}

@@ -99,6 +100,7 @@ void DocumentCanvas::removePainters() {

if (_selectedArea != nullptr) {
delete _selectedArea;
_selectedArea = nullptr;
}
}

@@ -448,6 +450,7 @@ lc::geo::Area DocumentCanvas::bounds() const {
void DocumentCanvas::makeSelection(double x, double y, double w, double h, bool occupies, bool addTo) {
if (_selectedArea != nullptr) {
delete _selectedArea;
_selectedArea = nullptr;
}

_selectedArea = new lc::geo::Area(lc::geo::Coordinate(x, y), lc::geo::Coordinate(x + w, y + h));

0 comments on commit f0d5dc5

Please sign in to comment.
You can’t perform that action at this time.