aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
Diffstat (limited to 'backends')
-rw-r--r--backends/fs/abstract-fs.h14
-rw-r--r--backends/platform/ios7/ios7_osys_main.cpp3
2 files changed, 15 insertions, 2 deletions
diff --git a/backends/fs/abstract-fs.h b/backends/fs/abstract-fs.h
index 34a8120caa..dcfdc08975 100644
--- a/backends/fs/abstract-fs.h
+++ b/backends/fs/abstract-fs.h
@@ -84,6 +84,20 @@ protected:
public:
/**
+ * Construct a FSNode object from an AbstractFSNode object.
+ *
+ * This is a helper to create Common::FSNode objects when the backend's
+ * FileSystemFactory cannot create the given AbstractFSNode object itself.
+ * All other code is supposed to use Common::FSNode's constructor itself.
+ *
+ * @param realNode Pointer to a heap allocated instance. FSNode will take
+ * ownership of the pointer.
+ */
+ static Common::FSNode makeFSNode(AbstractFSNode *realNode) {
+ return Common::FSNode(realNode);
+ }
+
+ /**
* Destructor.
*/
virtual ~AbstractFSNode() {}
diff --git a/backends/platform/ios7/ios7_osys_main.cpp b/backends/platform/ios7/ios7_osys_main.cpp
index 37fa34ce33..f169dbb1b2 100644
--- a/backends/platform/ios7/ios7_osys_main.cpp
+++ b/backends/platform/ios7/ios7_osys_main.cpp
@@ -301,8 +301,7 @@ void OSystem_iOS7::addSysArchivesToSearchSet(Common::SearchSet &s, int priority)
Common::String bundlePath((const char *)buf);
#ifdef IPHONE_SANDBOXED
POSIXFilesystemNode *posixNode = new POSIXFilesystemNode(bundlePath);
- Common::FSNode *node = new Common::FSNode(posixNode);
- s.add("__IOS_BUNDLE__", new Common::FSDirectory(*node), priority);
+ s.add("__IOS_BUNDLE__", new Common::FSDirectory(AbstractFSNode::makeFSNode(posixNode)), priority);
#else
s.add("__IOS_BUNDLE__", new Common::FSDirectory(bundlePath), priority);
#endif