mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-17 07:10:36 +00:00
Fix problem showing exception in ~ToolLoopImpl()
We cannot have DrawingState::m_toolLoopManager = nullptr when we call Console::showException() (as the Editor will continue sending some mouse messages to the DrawingState).
This commit is contained in:
parent
1bed018ab0
commit
61edf07fdc
@ -59,6 +59,7 @@ namespace app {
|
||||
enum Button { Left = 0, Right = 1 };
|
||||
|
||||
virtual ~ToolLoop() { }
|
||||
virtual void dispose() = 0;
|
||||
|
||||
// Returns the tool to use to draw or use
|
||||
virtual Tool* getTool() = 0;
|
||||
|
@ -201,6 +201,9 @@ void DrawingState::onExposeSpritePixels(const gfx::Region& rgn)
|
||||
|
||||
void DrawingState::destroyLoop()
|
||||
{
|
||||
if (m_toolLoop)
|
||||
m_toolLoop->dispose();
|
||||
|
||||
delete m_toolLoopManager;
|
||||
delete m_toolLoop;
|
||||
m_toolLoopManager = NULL;
|
||||
|
@ -184,7 +184,8 @@ public:
|
||||
m_offset.y = -y1;
|
||||
}
|
||||
|
||||
~ToolLoopImpl()
|
||||
// IToolLoop interface
|
||||
void dispose() override
|
||||
{
|
||||
bool redraw = false;
|
||||
|
||||
@ -230,7 +231,6 @@ public:
|
||||
update_screen_for_document(m_document);
|
||||
}
|
||||
|
||||
// IToolLoop interface
|
||||
tools::Tool* getTool() override { return m_tool; }
|
||||
Brush* getBrush() override { return m_brush; }
|
||||
Document* getDocument() override { return m_document; }
|
||||
|
Loading…
Reference in New Issue
Block a user