mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-06 03:39:51 +00:00
Show an error if we cannot create a ToolLoopImpl
The main issue at the moment is that a std::bad_alloc exception can be thrown if there isn't enough memory available when the user click the sprite editor to start drawing.
This commit is contained in:
parent
efbb3e52e2
commit
60602f78a8
@ -360,15 +360,26 @@ tools::ToolLoop* create_tool_loop(Editor* editor, Context* context, MouseMessage
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create the new tool loop
|
// Create the new tool loop
|
||||||
return
|
try
|
||||||
new ToolLoopImpl(editor,
|
{
|
||||||
context,
|
return new ToolLoopImpl(editor,
|
||||||
current_tool,
|
context,
|
||||||
editor->getDocument(),
|
current_tool,
|
||||||
msg->left() ? tools::ToolLoop::Left:
|
editor->getDocument(),
|
||||||
tools::ToolLoop::Right,
|
msg->left() ? tools::ToolLoop::Left:
|
||||||
msg->left() ? fg: bg,
|
tools::ToolLoop::Right,
|
||||||
msg->left() ? bg: fg);
|
msg->left() ? fg: bg,
|
||||||
|
msg->left() ? bg: fg);
|
||||||
|
}
|
||||||
|
catch (const std::exception& ex)
|
||||||
|
{
|
||||||
|
Alert::show(PACKAGE
|
||||||
|
"<<Error drawing ink:"
|
||||||
|
"<<%s"
|
||||||
|
"||&Close",
|
||||||
|
ex.what());
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace app
|
} // namespace app
|
||||||
|
Loading…
x
Reference in New Issue
Block a user