Fix infinite recursion when the tool emits done() in mouse release event
This patch fixes a crash when dropping shapes on canvas from Add Shapes docker.