diff options
Diffstat (limited to 'src/ExternalLexer.h')
-rw-r--r-- | src/ExternalLexer.h | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/ExternalLexer.h b/src/ExternalLexer.h index a85213e31..7804c19f0 100644 --- a/src/ExternalLexer.h +++ b/src/ExternalLexer.h @@ -38,26 +38,15 @@ public: virtual void SetExternal(GetLexerFactoryFunction fFactory, int index); }; -/// LexerMinder points to an ExternalLexerModule - so we don't leak them. -class LexerMinder { -public: - ExternalLexerModule *self; - LexerMinder *next; -}; - -/// LexerLibrary exists for every External Lexer DLL, contains LexerMinders. +/// LexerLibrary exists for every External Lexer DLL, contains ExternalLexerModules. class LexerLibrary { - DynamicLibrary *lib; - LexerMinder *first; - LexerMinder *last; - + std::unique_ptr<DynamicLibrary> lib; + std::vector<std::unique_ptr<ExternalLexerModule>> modules; public: - explicit LexerLibrary(const char *ModuleName); + explicit LexerLibrary(const char *moduleName_); ~LexerLibrary(); - void Release(); - LexerLibrary *next; - std::string m_sModuleName; + std::string moduleName; }; /// LexerManager manages external lexers, contains LexerLibrarys. @@ -73,11 +62,8 @@ public: private: LexerManager(); - static LexerManager *theInstance; - - void LoadLexerLibrary(const char *module); - LexerLibrary *first; - LexerLibrary *last; + static std::unique_ptr<LexerManager> theInstance; + std::vector<std::unique_ptr<LexerLibrary>> libraries; }; class LMMinder { |