Replace raw pointer with shared pointer

This commit is contained in:
JaMiT 2016-09-05 00:13:23 -05:00
parent 44741dc36d
commit 24a4dd8062
2 changed files with 4 additions and 4 deletions

View file

@ -94,7 +94,7 @@ void editor_toolkit::init_mouse_actions(context_manager& cmanager)
}
}
mouse_action_ = (mouse_actions_.find(hotkey::HOTKEY_EDITOR_TOOL_PAINT))->second.get();
mouse_action_ = (mouse_actions_.find(hotkey::HOTKEY_EDITOR_TOOL_PAINT))->second;
set_mouseover_overlay();
}
@ -104,7 +104,7 @@ void editor_toolkit::hotkey_set_mouse_action(hotkey::HOTKEY_COMMAND command)
mouse_action_map::iterator i = mouse_actions_.find(command);
if (i != mouse_actions_.end()) {
palette_manager_->active_palette().hide(true);
mouse_action_ = i->second.get();
mouse_action_ = i->second;
palette_manager_->adjust_size();
set_mouseover_overlay();
@ -120,7 +120,7 @@ void editor_toolkit::hotkey_set_mouse_action(hotkey::HOTKEY_COMMAND command)
bool editor_toolkit::is_mouse_action_set(hotkey::HOTKEY_COMMAND command) const
{
mouse_action_map::const_iterator i = mouse_actions_.find(command);
return (i != mouse_actions_.end()) && (i->second.get() == mouse_action_);
return (i != mouse_actions_.end()) && (i->second == mouse_action_);
}
common_palette& editor_toolkit::get_palette()

View file

@ -95,7 +95,7 @@ private:
//Tools
/** The current mouse action */
mouse_action* mouse_action_; // Never null (outside the constructor).
std::shared_ptr<mouse_action> mouse_action_; // Never null (outside the constructor).
/** The mouse actions */
typedef std::map<hotkey::HOTKEY_COMMAND, std::shared_ptr<mouse_action> > mouse_action_map;