Skip to content
Snippets Groups Projects
Commit 4c6ac566 authored by Sam Jenkins's avatar Sam Jenkins
Browse files

Re #25465 Removed raw owning pointers from nexus descriptor

parent 2217a851
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <string> #include <string>
#include <unordered_set> #include <unordered_set>
#include <utility> #include <utility>
#include <memory>
namespace NeXus { namespace NeXus {
class File; class File;
...@@ -110,7 +111,7 @@ private: ...@@ -110,7 +111,7 @@ private:
std::map<std::string, std::string> m_pathsToTypes; std::map<std::string, std::string> m_pathsToTypes;
/// Open NeXus handle /// Open NeXus handle
::NeXus::File *m_file; std::unique_ptr< ::NeXus::File> m_file;
}; };
} // namespace Kernel } // namespace Kernel
......
...@@ -142,7 +142,7 @@ NexusDescriptor::NexusDescriptor(const std::string &filename) ...@@ -142,7 +142,7 @@ NexusDescriptor::NexusDescriptor(const std::string &filename)
/** /**
*/ */
NexusDescriptor::~NexusDescriptor() { delete m_file; } NexusDescriptor::~NexusDescriptor() {}
/// Returns the name & type of the first entry in the file /// Returns the name & type of the first entry in the file
const std::pair<std::string, std::string> & const std::pair<std::string, std::string> &
...@@ -220,7 +220,7 @@ void NexusDescriptor::initialize(const std::string &filename) { ...@@ -220,7 +220,7 @@ void NexusDescriptor::initialize(const std::string &filename) {
m_filename = filename; m_filename = filename;
m_extension = "." + Poco::Path(filename).getExtension(); m_extension = "." + Poco::Path(filename).getExtension();
m_file = new ::NeXus::File(this->filename()); m_file = std::make_unique<::NeXus::File>(this->filename());
m_file->openPath("/"); m_file->openPath("/");
m_rootAttrs.clear(); m_rootAttrs.clear();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment