From eaa9f3875f37ecfb8f41d9479daf3d0b18cd1e82 Mon Sep 17 00:00:00 2001 From: shun_iwasawa Date: May 26 2017 11:06:19 +0000 Subject: fix plastictool tooloption crash --- diff --git a/toonz/sources/tnztools/plastictool.cpp b/toonz/sources/tnztools/plastictool.cpp index c877c3c..93f7a30 100644 --- a/toonz/sources/tnztools/plastictool.cpp +++ b/toonz/sources/tnztools/plastictool.cpp @@ -387,8 +387,10 @@ void PlasticToolOptionsBox::SkelIdsComboBox::updateCurrentSkeleton() { //**************************************************************************************** PlasticToolOptionsBox::PlasticToolOptionsBox(QWidget *parent, TTool *tool, - TPaletteHandle *pltHandle) - : GenericToolOptionsBox(parent, tool, pltHandle, PlasticTool::MODES_COUNT) + TPaletteHandle *pltHandle, + ToolHandle *toolHandle) + : GenericToolOptionsBox(parent, tool, pltHandle, PlasticTool::MODES_COUNT, + toolHandle) , m_tool(tool) , m_subToolbars(new GenericToolOptionsBox *[PlasticTool::MODES_COUNT]) //, m_subToolbarActions(new QAction*[PlasticTool::MODES_COUNT]) @@ -721,8 +723,9 @@ ToolOptionsBox *PlasticTool::createOptionsBox() { // Create the options box TPaletteHandle *currPalette = TTool::getApplication()->getPaletteController()->getCurrentLevelPalette(); + ToolHandle *currTool = m_application->getCurrentTool(); PlasticToolOptionsBox *optionsBox = - new PlasticToolOptionsBox(0, this, currPalette); + new PlasticToolOptionsBox(0, this, currPalette, currTool); // Connect it to receive m_mode notifications m_mode.addListener(optionsBox); diff --git a/toonz/sources/tnztools/plastictool.h b/toonz/sources/tnztools/plastictool.h index 0b5b807..51be286 100644 --- a/toonz/sources/tnztools/plastictool.h +++ b/toonz/sources/tnztools/plastictool.h @@ -402,8 +402,8 @@ class PlasticToolOptionsBox final : public GenericToolOptionsBox, Q_OBJECT public: - PlasticToolOptionsBox(QWidget *parent, TTool *tool, - TPaletteHandle *pltHandle); + PlasticToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle, + ToolHandle *toolHandle); private: class SkelIdsComboBox;