From e7501e0aeae6a88cc4bbd230911e4a8066a5b101 Mon Sep 17 00:00:00 2001 From: turtletooth Date: Jul 05 2016 06:34:28 +0000 Subject: Merge pull request #579 from shun-iwasawa/fix_brush_undo_crash Fix crash on undo brush tool --- diff --git a/toonz/sources/tnztools/toolutils.cpp b/toonz/sources/tnztools/toolutils.cpp index 2c73a37..666da37 100644 --- a/toonz/sources/tnztools/toolutils.cpp +++ b/toonz/sources/tnztools/toolutils.cpp @@ -1067,7 +1067,8 @@ void ToolUtils::UndoPencil::undo() const { if (!stroke) return; image->deleteStroke(stroke); TSelection *selection = app->getCurrentSelection()->getSelection(); - if (StrokeSelection *strokeSelection = (StrokeSelection *)selection) + StrokeSelection *strokeSelection = dynamic_cast(selection); + if (strokeSelection) strokeSelection->selectNone(); UINT size = m_fillInformation->size();