fix rtWrap_unwrap refcounting
This commit is contained in:
parent
0589d63cc5
commit
168db4cf01
@ -258,11 +258,11 @@ B rtWrap_wrap(B t, bool nnbi) {
|
|||||||
#endif
|
#endif
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
B rtWrap_unwrap(B x) {
|
B rtWrap_unwrap(B x) { // consumes x
|
||||||
if (!isVal(x)) return x;
|
if (!isVal(x)) return x;
|
||||||
if (TY(x)==t_funWrap) { B r = c(WFun,x)->v; dec(x); return r; }
|
if (TY(x)==t_funWrap) { B r = c(WFun,x)->v; decG(x); return inc(r); }
|
||||||
if (TY(x)==t_md1Wrap) { B r = c(WMd1,x)->v; dec(x); return r; }
|
if (TY(x)==t_md1Wrap) { B r = c(WMd1,x)->v; decG(x); return inc(r); }
|
||||||
if (TY(x)==t_md2Wrap) { B r = c(WMd2,x)->v; dec(x); return r; }
|
if (TY(x)==t_md2Wrap) { B r = c(WMd2,x)->v; decG(x); return inc(r); }
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user