andy128k / cl-gobject-introspection

BSD 2-Clause "Simplified" License
49 stars 15 forks source link

Garbage collection for info-ffi and struct allocated via cffi:foreign-alloc #24

Closed hying-caritas closed 10 years ago

hying-caritas commented 10 years ago

Any comments for this pull request?

andy128k commented 10 years ago

I think it's ok to use trivial garbage for reference counted objects. But I doubt in case of plain structure. There is possibility to deallocate memory owned by foreign code.

hying-caritas commented 10 years ago

Yes. You are right. If we passed the allocated struct to foreign code and we garbage collecting it in lisp, it will cause issue. I will prepare a new pull request to replace this with an explicit de-allocate method.