Re: gperl_callback_invoke userdata copy
- From: Kevin Ryde <user42 zip com au>
- To: gtk-perl-list gnome org
- Subject: Re: gperl_callback_invoke userdata copy
- Date: Wed, 17 Sep 2008 11:45:23 +1000
Torsten Schoenfeld <kaffeetisch gmx de> writes:
This confuses me. The paragraph above the code seems to say that altering
$_[-1] does *not* modify the variable passed to signal_connect()
That's so. Something like
my $something = 1;
$obj->signal_connect (sig => &my_func, $something);
sub my_func {
$_[-1] = 2;
}
Leaves the original $something unchanged. signal_connect() copies with
newSVsv then passes that new sv to the callbacks. I'll try to reword it
a bit. Perhaps there's somewhere good in the main perl docs that could
be cross referenced on that sort of copy/shallow-copy/whatnot.
-- but the
point of this thread has been to guarantee that it does, right?
Well, the net point is supposed to be a refcount fix, but detouring
unintendedly via an extra sv copy. :)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]