Fixing issue 211. Check to see if m_currPath is NULL before doing anything in mouseReleaseEvent. Multiple mouse release events can occur after a mouse press and before the next mouse press if you mouse-click really fast.
authorZorg <zorgiepoo@gmail.com>
Tue, 05 Apr 2011 16:15:20 -0400
changeset 5108 b7483e29ea8c
parent 5105 79faa1130011
child 5116 d70febb51125
Fixing issue #211. Check to see if m_currPath is NULL before doing anything in mouseReleaseEvent. Multiple mouse release events can occur after a mouse press and before the next mouse press if you mouse-click really fast.
QTfrontend/drawmapscene.cpp
--- a/QTfrontend/drawmapscene.cpp	Tue Apr 05 16:05:41 2011 -0400
+++ b/QTfrontend/drawmapscene.cpp	Tue Apr 05 16:15:20 2011 -0400
@@ -86,14 +86,17 @@
 
 void DrawMapScene::mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent)
 {
-    QPainterPath path = m_currPath->path();
-    path.lineTo(mouseEvent->scenePos());
-    paths.first().append(mouseEvent->scenePos().toPoint());
-    m_currPath->setPath(path);
+    if (m_currPath)
+    {
+        QPainterPath path = m_currPath->path();
+        path.lineTo(mouseEvent->scenePos());
+        paths.first().append(mouseEvent->scenePos().toPoint());
+        m_currPath->setPath(path);
 
-    simplifyLast();
+        simplifyLast();
 
-    m_currPath = 0;
+        m_currPath = 0;
+    }
 }
 
 void DrawMapScene::undo()