used make_shared and make_unique for creating shared pointers

This commit is contained in:
asapelkin
2019-10-24 09:50:31 +03:00
committed by wmayer
parent bbbabf99ae
commit f13a7627ae
3 changed files with 10 additions and 5 deletions

View File

@@ -26,6 +26,8 @@
#include <QVBoxLayout>
#endif
#include <memory>
#include <sstream>
#include <Base/Console.h>
@@ -70,7 +72,7 @@ void View::slotActiveDocument(const Document &documentIn)
ModelMap::const_iterator it = modelMap.find(&documentIn);
if (it == modelMap.end())
{
ModelMap::value_type entry(std::make_pair(&documentIn, std::shared_ptr<Model>(new Model(this, documentIn))));
ModelMap::value_type entry(std::make_pair(&documentIn, std::make_shared<Model>(this, documentIn)));
modelMap.insert(entry);
this->setScene(entry.second.get());
}