in reply to Re^10: Segfault on second (identical) call to a sub
in thread Segfault on second (identical) call to a sub
I'm no expert on XS files either, which is why I usually let Inline::C handle that side of things ... but I don't think 'data' should be safefree()'d ... and I wish you had pointed it out sooner :-)
I got sidetracked into thinking that there must be something bodgey in the way the GD::Image objects were being created.
You could probably go a little further and not even declare and assign a value to 'data'. I think one could just as well write
It's unclear to me how 'len' gets assigned the appropriate value for when it's needed ... but it seems to happen ok.
You should probably go to http://rt.cpan.org/Public/Dist/Display.html?Name=GD and report the bug there - or at least let the author know.
Well spotted !!
Cheers,
Rob
I got sidetracked into thinking that there must be something bodgey in the way the GD::Image objects were being created.
You could probably go a little further and not even declare and assign a value to 'data'. I think one could just as well write
but that's only a minor point.RETVAL = (GD__Image) gdImageCreateFromGdPtr(len,(void*)SvPV(imageData, + len));
It's unclear to me how 'len' gets assigned the appropriate value for when it's needed ... but it seems to happen ok.
You should probably go to http://rt.cpan.org/Public/Dist/Display.html?Name=GD and report the bug there - or at least let the author know.
Well spotted !!
Cheers,
Rob
In Section
Seekers of Perl Wisdom