thread->init_function = newSV(0);
sv_copypv(thread->init_function, init_function);
} else {
- thread->init_function = sv_dup(init_function, &clone_param);
- if (SvREFCNT(thread->init_function) == 0) {
- SvREFCNT_inc_void(thread->init_function);
- }
+ thread->init_function =
+ SvREFCNT_inc(sv_dup(init_function, &clone_param));
}
thread->params = sv_dup(params, &clone_param);
print do 'op/threads_create.pl' || die $@;
EOI
-
-TODO: {
- no strict 'vars'; # Accessing $TODO from test.pl
- local $TODO = 'refcount issues with threads';
-
# Attempt to free unreferenced scalar...
fresh_perl_is(<<'EOI', 'ok', { }, 'thread sub via scalar');
use threads;
print 'ok';
EOI
+TODO: {
+ no strict 'vars'; # Accessing $TODO from test.pl
+ local $TODO = 'refcount issues with threads';
+
+
+
# Scalars leaked: 1
foreach my $BLOCK (qw(CHECK INIT)) {
fresh_perl_is(<<EOI, 'ok', { }, "threads in $BLOCK block");