You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
934 B

  1. From 7e75018ba60a9f50ea9e936eb1b6eb6b44dbc668 Mon Sep 17 00:00:00 2001
  2. From: J-P Nurmi <jpnurmi@gmail.com>
  3. Date: Sat, 28 Feb 2015 21:15:23 +0100
  4. Subject: [PATCH] Fix chansaver loading
  5. CModules::LoadModule() sets the module type _after_ construction.
  6. The constructor cannot therefore do actions based on the module
  7. type. Move loading to OnLoad().
  8. ---
  9. modules/chansaver.cpp | 10 +++++++---
  10. 1 file changed, 7 insertions(+), 3 deletions(-)
  11. --- a/modules/chansaver.cpp
  12. +++ b/modules/chansaver.cpp
  13. @@ -21,6 +21,12 @@
  14. class CChanSaverMod : public CModule {
  15. public:
  16. MODCONSTRUCTOR(CChanSaverMod) {
  17. + }
  18. +
  19. + virtual ~CChanSaverMod() {
  20. + }
  21. +
  22. + bool OnLoad(const CString& sArgsi, CString& sMessage) override {
  23. switch (GetType()) {
  24. case CModInfo::GlobalModule:
  25. LoadUsers();
  26. @@ -32,9 +38,7 @@ public:
  27. LoadNetwork(GetNetwork());
  28. break;
  29. }
  30. - }
  31. -
  32. - virtual ~CChanSaverMod() {
  33. + return true;
  34. }
  35. void LoadUsers() {