summaryrefslogtreecommitdiff
path: root/embed.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-01-02 14:51:21 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-01-02 18:33:05 -0800
commit4155e4fe81b9987a30efea627e43a574f5460f73 (patch)
tree707c9726e1f53d5a85d30a8fb2d4294e66d4523a /embed.h
parentfd520d362aeb1b4dd5c384035916a9d3f3db5d35 (diff)
downloadperl-4155e4fe81b9987a30efea627e43a574f5460f73.tar.gz
[perl #36347] Object destruction incomplete
do_clean_objs only looks for objects referenced by RVs, so blessed array references and lexical variables (and probably other SVs, too) are not DESTROYed. This commit adds a new visit() call to sv_clean_objs, which curses (DESTROYs and un-blesses, leaving the reference count as it is) any objects that are still left after do_clean_named_io_objs. The new do_curse routine (a pointer to which is passeds to visit()) follows do_clean_named_io_objs’ example and explicitly skips the STDOUT and STDERR handles, in case destructors need to use them. The cursing code, which is now called from two places, is moved out of sv_clear and put in its own routine. The check that the reference count is zero does not apply when called from sv_clean_objs, so the new S_curse routine takes a boolean argument that determines whether that check should take place.
Diffstat (limited to 'embed.h')
-rw-r--r--embed.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/embed.h b/embed.h
index 083588ef56..e393a01739 100644
--- a/embed.h
+++ b/embed.h
@@ -1782,6 +1782,7 @@
#define F0convert S_F0convert
#define anonymise_cv_maybe(a,b) S_anonymise_cv_maybe(aTHX_ a,b)
#define assert_uft8_cache_coherent(a,b,c,d) S_assert_uft8_cache_coherent(aTHX_ a,b,c,d)
+#define curse(a,b) S_curse(aTHX_ a,b)
#define expect_number(a) S_expect_number(aTHX_ a)
#define find_array_subscript(a,b) S_find_array_subscript(aTHX_ a,b)
#define find_hash_subscript(a,b) S_find_hash_subscript(aTHX_ a,b)