summaryrefslogtreecommitdiffstats
path: root/src/message-context.h
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-11-22 04:17:27 +0000
committerTavmjong Bah <tavmjong@free.fr>2018-12-03 09:35:13 +0000
commit6af653ae04272a27390821842d3e8e23c6af3efe (patch)
tree33956cb2251979c6d3b06882d858a6c36f8c5dfc /src/message-context.h
parentAdd other sofwar binds to new keys, add missing one (diff)
downloadinkscape-6af653ae04272a27390821842d3e8e23c6af3efe.tar.gz
inkscape-6af653ae04272a27390821842d3e8e23c6af3efe.zip
Replace InkGC with std::shared_ptr for MessageStack
There are many places which still use this stack unmanaged (using desktop->getMessageStack()) but those are all leaf calls which make use of the stack and never store it anywhere, so this is fine.
Diffstat (limited to 'src/message-context.h')
-rw-r--r--src/message-context.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/message-context.h b/src/message-context.h
index 3873d3b64..cfe155aa3 100644
--- a/src/message-context.h
+++ b/src/message-context.h
@@ -16,6 +16,7 @@
#define SEEN_INKSCAPE_MESSAGE_CONTEXT_H
#include <cstdarg>
+#include <memory>
#include <glib.h>
#include "message.h"
@@ -42,7 +43,7 @@ public:
*
* @param stack the Inkscape::MessageStack to use for our messages
*/
- MessageContext(MessageStack *stack);
+ MessageContext(std::shared_ptr<MessageStack> stack);
~MessageContext();
/** @brief pushes a message on the stack, replacing our old message
@@ -100,7 +101,7 @@ public:
void clear();
private:
- MessageStack *_stack; ///< the message stack to use
+ std::shared_ptr<MessageStack> _stack; ///< the message stack to use
MessageId _message_id; ///< our current message id, or 0
MessageId _flash_message_id; ///< current flashed message id, or 0
};