summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rbot/ircbot.rb10
-rw-r--r--lib/rbot/plugins.rb4
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index d83a5fe4..f5250b9b 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -809,7 +809,9 @@ class IrcBot
debug "Saving"
save
debug "Cleaning up"
- @plugins.cleanup
+ @save_mutex.synchronize do
+ @plugins.cleanup
+ end
# debug "Closing registries"
# @registry.close
debug "Cleaning up the db environment"
@@ -848,8 +850,10 @@ class IrcBot
# call the rescan method for all of the botmodules
def rescan
- @lang.rescan
- @plugins.rescan
+ @save_mutex.synchronize do
+ @lang.rescan
+ @plugins.rescan
+ end
end
# channel:: channel to join
diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb
index b55fbe4a..848240cf 100644
--- a/lib/rbot/plugins.rb
+++ b/lib/rbot/plugins.rb
@@ -417,9 +417,7 @@ module Plugins
# call the cleanup method for each active plugin
def cleanup
- @bot.save_mutex.synchronize do
- delegate 'cleanup'
- end
+ delegate 'cleanup'
reset_botmodule_lists
end