diff options
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-11-22 05:59:31 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2018-12-03 09:35:13 +0000 |
| commit | da21d890c67eb751e12f0af89aac67ecb2629ca0 (patch) | |
| tree | 0a100c27779967329616f87da2c7be8d613c9273 /src/desktop.cpp | |
| parent | Replace InkGC with std::shared_ptr for MessageStack (diff) | |
| download | inkscape-da21d890c67eb751e12f0af89aac67ecb2629ca0.tar.gz inkscape-da21d890c67eb751e12f0af89aac67ecb2629ca0.zip | |
Use std::unique_ptr for all MessageContext
Diffstat (limited to 'src/desktop.cpp')
| -rw-r--r-- | src/desktop.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp index 1936226d4..68eca8cdf 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -147,7 +147,7 @@ SPDesktop::init (SPNamedView *nv, SPCanvas *aCanvas, Inkscape::UI::View::EditWid Inkscape::ResourceManager::getManager(); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - _guides_message_context = new Inkscape::MessageContext(messageStack()); + _guides_message_context = std::unique_ptr<Inkscape::MessageContext>(new Inkscape::MessageContext(messageStack())); current = prefs->getStyle("/desktop/style"); @@ -376,7 +376,6 @@ void SPDesktop::destroy() drawing = nullptr; } - delete _guides_message_context; _guides_message_context = nullptr; } @@ -685,7 +684,7 @@ void SPDesktop::setEventContext(const std::string& toolName) } else { event_context = ToolFactory::createObject(toolName); event_context->desktop = this; - event_context->message_context = new Inkscape::MessageContext(this->messageStack()); + event_context->message_context = std::unique_ptr<Inkscape::MessageContext>(new Inkscape::MessageContext(this->messageStack())); event_context->setup(); // Make sure no delayed snapping events are carried over after switching tools |
