Diffusion Krita 45bdec0ecd0b

Make sure active tool is deactivated before closing the document

Authored by dkazakov on May 23 2019, 3:55 PM.

Description

Make sure active tool is deactivated before closing the document

When a document is closed, its canvas gets destroyed. The problem is
that the tools get destroyed in active state. That might be not very
obvious from API point of view.

NOTE1: do *not* backport it to 4.2, the patch is too dangerous
NOTE2: this patch is *not* a fix for 407228, it is just related
CCBUG:407228