Changeset 22189 for v6

Show
Ignore:
Timestamp:
09/08/08 19:34:27 (3 months ago)
Author:
ruoso
Message:

[smop] fix leak in native_int... test/31 no longer leaks, but that means the other leaks are not related to this one.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • v6/smop/src/native_int.c

    r22092 r22189  
    4848    SMOP__Object* other = SMOP__NATIVE__capture_positional(interpreter,capture,0); 
    4949    if (other && SMOP_RI(other) == (SMOP__ResponderInterface*)SMOP__NATIVE__int) { 
     50      SMOP_RELEASE(interpreter, capture); 
    5051      return other; 
    5152    } else { 
    5253      if (other) SMOP_RELEASE(interpreter, other); 
     54      SMOP_RELEASE(interpreter, capture); 
    5355      return SMOP__NATIVE__int_create(0); 
    5456    } 
     
    5860    ___NATIVE_CAPTURE_ONLY___; 
    5961    ___INVOCANT_RI_SHOULD_MATCH___; 
    60      
     62 
    6163    smop_lowlevel_wrlock(invocant); 
    6264    ((smop_native_int_struct*)invocant)->intvalue++; 
    6365    smop_lowlevel_unlock(invocant); 
    64      
     66 
     67    SMOP_RELEASE(interpreter, invocant); 
     68 
    6569  } else { 
    6670    ___UNKNOWN_METHOD___;