Skip to content
This repository
Browse code

SVs that we dont return via RETVAL must be made mortal

  • Loading branch information...
commit c80743652ecf0805856b1f0a663df2041fe6a31e 1 parent a66253c
Tobias Leich FROGGS authored

Showing 1 changed file with 5 additions and 5 deletions. Show diff stats Hide diff stats

  1. +5 5 src/SDLx/Validate.xs
10 src/SDLx/Validate.xs
@@ -38,7 +38,7 @@ val__color_arrayref( color, ... )
38 38 CODE:
39 39 RETVAL = items > 1
40 40 ? _color_arrayref( color, ST(1) )
41   - : _color_arrayref( color, newSVuv(0) );
  41 + : _color_arrayref( color, sv_2mortal(newSVuv(0)) );
42 42 OUTPUT:
43 43 RETVAL
44 44
@@ -48,10 +48,10 @@ val_num_rgb( color )
48 48 CODE:
49 49 char *format = _color_format( color );
50 50 if( 0 == strcmp("number", format) )
51   - RETVAL = _color_number(color, newSVuv(0));
  51 + RETVAL = _color_number( color, sv_2mortal(newSVuv(0)) );
52 52 else if( 0 == strcmp("arrayref", format) )
53 53 {
54   - AV *c = _color_arrayref( (AV *)SvRV(color), newSVuv(0) );
  54 + AV *c = _color_arrayref( (AV *)SvRV(color), sv_2mortal(newSVuv(0)) );
55 55 unsigned int v = (( SvUV(AvARRAY(c)[0]) << 16 ) + ( SvUV(AvARRAY(c)[1]) << 8 ) + SvUV(AvARRAY(c)[2]));
56 56 RETVAL = newSVuv(v);
57 57 }
@@ -73,11 +73,11 @@ val_num_rgba( color )
73 73 char *format = _color_format( color );
74 74 if( 0 == strcmp("number", format) )
75 75 {
76   - RETVAL = _color_number(color, newSVuv(1));
  76 + RETVAL = _color_number( color, sv_2mortal(newSVuv(1)) );
77 77 }
78 78 else if( 0 == strcmp("arrayref", format) )
79 79 {
80   - AV *c = _color_arrayref( (AV *)SvRV(color), newSVuv(1) );
  80 + AV *c = _color_arrayref( (AV *)SvRV(color), sv_2mortal(newSVuv(1)) );
81 81 unsigned int v = (SvUV(AvARRAY(c)[0]) << 24) + (SvUV(AvARRAY(c)[1]) << 16) + (SvUV(AvARRAY(c)[2]) << 8) + SvUV(AvARRAY(c)[3] );
82 82 RETVAL = newSVuv(v);
83 83 }

0 comments on commit c807436

Please sign in to comment.
Something went wrong with that request. Please try again.