Hull node is no longer added if linked node is deleted while it was calculating

CURA-637
This commit is contained in:
Jaime van Kessel 2016-02-01 17:03:53 +01:00
parent 782c4508c6
commit ebc1df1a4c

View File

@ -64,12 +64,17 @@ class ConvexHullJob(Job):
hull = hull.getMinkowskiHull(Polygon(numpy.array(profile.getSettingValue("machine_head_polygon"),numpy.float32)))
else:
self._node.callDecoration("setConvexHullHead", None)
if self._node.getParent() is None: #Node was already deleted before job is done.
self._node.callDecoration("setConvexHullNode",None)
self._node.callDecoration("setConvexHull", None)
self._node.callDecoration("setConvexHullJob", None)
return
hull_node = ConvexHullNode.ConvexHullNode(self._node, hull, Application.getInstance().getController().getScene().getRoot())
self._node.callDecoration("setConvexHullNode", hull_node)
self._node.callDecoration("setConvexHull", hull)
self._node.callDecoration("setConvexHullJob", None)
if self._node.getParent().callDecoration("isGroup"):
if self._node.getParent() and self._node.getParent().callDecoration("isGroup"):
job = self._node.getParent().callDecoration("getConvexHullJob")
if job:
job.cancel()