Close any open connections if the thread happens to have one when it finishes.

Partial bandaid for new AR pool mgmt methods
This commit is contained in:
HD Moore 2012-04-16 21:49:47 -05:00
parent 362e80dc41
commit 12102b9adc
1 changed files with 3 additions and 0 deletions

View File

@ -67,6 +67,9 @@ class ThreadManager < Array
elog("Call Stack\n#{e.backtrace.join("\n")}")
raise e
end
if framework.db and framework.db.active
::ActiveRecord::Base.connection.close if ActiveRecord::Base.connection
end
end
else
t = ::Thread.new(name, crit, caller, *args) do |*argv|