diff options
author | saturneric <[email protected]> | 2023-10-18 09:49:06 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2023-10-18 09:49:06 +0000 |
commit | 216905e2532a79101e987e936fdf8b353b2a4dab (patch) | |
tree | 2b148028d738e8254a763b9814689679a66b21fc /src/core/module/GlobalModuleContext.cpp | |
parent | chore: fetch the latest release of the json library (diff) | |
download | GpgFrontend-216905e2532a79101e987e936fdf8b353b2a4dab.tar.gz GpgFrontend-216905e2532a79101e987e936fdf8b353b2a4dab.zip |
fix: improve thread and module relation
Diffstat (limited to 'src/core/module/GlobalModuleContext.cpp')
-rw-r--r-- | src/core/module/GlobalModuleContext.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/module/GlobalModuleContext.cpp b/src/core/module/GlobalModuleContext.cpp index 69743915..7e5f8f00 100644 --- a/src/core/module/GlobalModuleContext.cpp +++ b/src/core/module/GlobalModuleContext.cpp @@ -121,6 +121,9 @@ class GlobalModuleContext::Impl { register_info.task_runner = std::make_shared<Thread::TaskRunner>(); register_info.task_runner->start(); + // move module to its task runner' thread + register_info.module->moveToThread(register_info.task_runner.get()); + // Register the module with its identifier. module_register_table_[module->GetModuleIdentifier()] = std::make_shared<ModuleRegisterInfo>(std::move(register_info)); |