summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-07-03 14:42:10 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-07-07 11:26:44 +0100
commitfccf6929549abdaa7405b6d0f68187575f4e9300 (patch)
tree65a077122707fe442bddbf26b80e150080cacf5f
parentfe315f634c7db0f30fc828421258e89f6dded346 (diff)
downloadlibguestfs-fccf6929549abdaa7405b6d0f68187575f4e9300.tar.gz
libguestfs-fccf6929549abdaa7405b6d0f68187575f4e9300.tar.xz
libguestfs-fccf6929549abdaa7405b6d0f68187575f4e9300.zip
perl, python, ruby: Fix comments on call to close method.
Make the comments consistent. Also make the Perl example call $g->close explicitly so it is consistent with the other examples. (cherry picked from commit 27ebf517fae972eee49ae5911a03fabe5f4b6e54)
-rwxr-xr-xperl/examples/create_disk.pl5
-rw-r--r--python/examples/create_disk.py3
-rw-r--r--ruby/examples/create_disk.rb3
3 files changed, 10 insertions, 1 deletions
diff --git a/perl/examples/create_disk.pl b/perl/examples/create_disk.pl
index 49538a5f..fa15bc7b 100755
--- a/perl/examples/create_disk.pl
+++ b/perl/examples/create_disk.pl
@@ -57,4 +57,7 @@ $g->mkdir ("/foo");
# the disk image.
$g->upload ("/etc/resolv.conf", "/foo/resolv.conf");
-exit 0
+# Note also that handles are automatically closed if they are
+# reaped by reference counting. You only need to call close
+# if you want to close the handle right away.
+$g->close ();
diff --git a/python/examples/create_disk.py b/python/examples/create_disk.py
index bf47c916..0885383e 100644
--- a/python/examples/create_disk.py
+++ b/python/examples/create_disk.py
@@ -51,4 +51,7 @@ g.mkdir ("/foo")
# the disk image.
g.upload ("/etc/resolv.conf", "/foo/resolv.conf")
+# Note also that handles are automatically closed if they are
+# reaped by reference counting. You only need to call close
+# if you want to close the handle right away.
g.close ()
diff --git a/ruby/examples/create_disk.rb b/ruby/examples/create_disk.rb
index 4e42cf6a..026ea2e7 100644
--- a/ruby/examples/create_disk.rb
+++ b/ruby/examples/create_disk.rb
@@ -54,4 +54,7 @@ g.mkdir("/foo")
# the disk image.
g.upload("/etc/resolv.conf", "/foo/resolv.conf")
+# Note also that handles are automatically closed if they are
+# reaped by the garbage collector. You only need to call close
+# if you want to close the handle right away.
g.close()