Let's make sure we unregister configuration-wise before we check to see if the plugin isn't loaded.

This commit is contained in:
Jeremy Fincher 2004-08-19 16:51:57 +00:00
parent cc4b76a8f3
commit d26b311fef

View File

@ -552,13 +552,15 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
if ircutils.strEqual(name, self.name()): if ircutils.strEqual(name, self.name()):
irc.error('You can\'t unload the %s plugin.' % name) irc.error('You can\'t unload the %s plugin.' % name)
return return
# Let's do this so even if the plugin isn't currently loaded, it doesn't
# stay attempting to load.
conf.registerPlugin(name, False)
callbacks = irc.removeCallback(name) callbacks = irc.removeCallback(name)
if callbacks: if callbacks:
for callback in callbacks: for callback in callbacks:
callback.die() callback.die()
del callback del callback
gc.collect() gc.collect()
conf.registerPlugin(name, False)
irc.replySuccess() irc.replySuccess()
else: else:
irc.error('There was no plugin %s.' % name) irc.error('There was no plugin %s.' % name)