summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-02 16:11:04 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-02 16:11:04 +0000
commitb086280f1df18bcea13b67d5ac7aa1693357823d (patch)
tree2cc763cdb736fc5bc706b51bd2638fa989af0b6a /lib
parent053f37c01ca7a68d3c87554b3526fc9281b4b2e1 (diff)
downloadpuppet-b086280f1df18bcea13b67d5ac7aa1693357823d.tar.gz
puppet-b086280f1df18bcea13b67d5ac7aa1693357823d.tar.xz
puppet-b086280f1df18bcea13b67d5ac7aa1693357823d.zip
Removing type/provider references on type removal
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1525 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/provider.rb6
-rw-r--r--lib/puppet/type.rb6
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/puppet/provider.rb b/lib/puppet/provider.rb
index f614eb0e9..f51ea4450 100644
--- a/lib/puppet/provider.rb
+++ b/lib/puppet/provider.rb
@@ -139,6 +139,12 @@ class Puppet::Provider
return true
end
+ # Remove the reference to the model, so GC can clean up.
+ def clear
+ @model = nil
+ end
+
+ # Retrieve a named command.
def command(name)
self.class.command(name)
end
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb
index a5a8cf966..8f29d79bf 100644
--- a/lib/puppet/type.rb
+++ b/lib/puppet/type.rb
@@ -1262,6 +1262,12 @@ class Type < Puppet::Element
@parent.delete(self)
@parent = nil
end
+
+ # Remove the reference to the provider.
+ if defined? @provider
+ @provider.clear
+ @provider = nil
+ end
end
# Is the named state defined?