sexp_release_object fix from Ben Weaver - wasn't releasing

the first object in the list.
This commit is contained in:
Alex Shinn 2012-06-14 22:37:10 +09:00
parent f9c640f180
commit 855af6120b
2 changed files with 3 additions and 1 deletions

View file

@ -11,6 +11,7 @@ Thanks to the following people for patches and bug reports:
* Alexander Shendi * Alexander Shendi
* Andreas Rottman * Andreas Rottman
* Bakul Shah * Bakul Shah
* Ben Weaver
* Bruno Deferrari * Bruno Deferrari
* Doug Currie * Doug Currie
* Derrick Eddington * Derrick Eddington

3
gc.c
View file

@ -85,7 +85,8 @@ void sexp_release_object(sexp ctx, sexp x) {
ls1=ls2, ls2=sexp_cdr(ls2)) ls1=ls2, ls2=sexp_cdr(ls2))
if (sexp_car(ls2) == x) { if (sexp_car(ls2) == x) {
if (ls1) sexp_cdr(ls1) = sexp_cdr(ls2); if (ls1) sexp_cdr(ls1) = sexp_cdr(ls2);
else sexp_global(ctx, SEXP_G_PRESERVATIVES) = ls2; else sexp_global(ctx, SEXP_G_PRESERVATIVES) = sexp_cdr(ls2);
break;
} }
} }