• R/O
  • SSH
  • HTTPS

green-candy: 提交


Commit MetaInfo

修订版12 (tree)
时间2022-01-13 21:28:04
作者quiret

Log Message

- refactored the project directory layout to be more manageable

更改概述

差异

--- blueMods/fileSystem/ml_base.cpp (revision 11)
+++ blueMods/fileSystem/ml_base.cpp (revision 12)
@@ -18,19 +18,30 @@
1818
1919 #include "StdInc.h"
2020
21+#include <NativeExecutive/CExecutiveManager.h>
22+
2123 ILuaModuleManager10 *pModuleManager = nullptr;
2224 CFileSystemInterface *pubFileSystem = nullptr;
25+NativeExecutive::CExecutiveManager *natExecMan = nullptr;
2326
2427 // Initialisation function (module entrypoint)
2528 MTAEXPORT bool InitModule ( ILuaModuleManager10 *pManager, char *szModuleName, char *szAuthor, float *fVersion )
2629 {
2730 pModuleManager = pManager;
31+ natExecMan = NativeExecutive::CExecutiveManager::Create();
32+ try
2833 {
2934 fs_construction_params fsparams;
30- // TODO: properly configure the Eir FileSystem module here.
35+ fsparams.nativeExecMan = natExecMan;
36+ // TODO: anything left to configure for the Eir FileSystem module here?
3137
3238 pubFileSystem = CFileSystem::Create( fsparams );
3339 }
40+ catch( ... )
41+ {
42+ NativeExecutive::CExecutiveManager::Delete( natExecMan );
43+ return false;
44+ }
3445
3546 // Set the module info
3647 strncpy ( szModuleName, MODULE_NAME, MAX_INFO_LENGTH );
@@ -60,6 +71,13 @@
6071
6172 MTAEXPORT bool ShutdownModule ( void )
6273 {
63-
74+ if ( pubFileSystem != nullptr )
75+ {
76+ CFileSystem::Destroy( (CFileSystem*)pubFileSystem );
77+ }
78+ if ( natExecMan != nullptr )
79+ {
80+ NativeExecutive::CExecutiveManager::Delete( natExecMan );
81+ }
6482 return true;
6583 }
Show on old repository browser