$exception ||= e
ensure
unless $opts[:no_threads]
- PollManager.stop
- SuicideManager.stop
+ PollManager.stop if PollManager.instantiated?
+ SuicideManager.stop if PollManager.instantiated?
Index.stop_lock_update_thread
end
end
def finish
- Redwood::PollManager.stop
Redwood::LabelManager.save if Redwood::LabelManager.instantiated?
Redwood::ContactManager.save if Redwood::ContactManager.instantiated?
Redwood::PersonManager.save if Redwood::PersonManager.instantiated?
def deinstantiate!; @instance = nil; end
def method_missing meth, *a, &b
raise "no instance defined!" unless defined? @instance
+
+ ## if we've been deinstantiated, just drop all calls. this is
+ ## useful because threads that might be active during the
+ ## cleanup process (e.g. polling) would otherwise have to
+ ## special-case every call to a Singleton object
+ return nil if @instance.nil?
+
@instance.send meth, *a, &b
end
def i_am_the_instance o