Ferada / cl-cffi-gtk

#cl-cffi-gtk on Freenode. A Lisp binding to GTK+3. SBCL/CCL/ABCL (ECL/CLISP unstable)
http://www.crategus.com/books/cl-cffi-gtk
41 stars 8 forks source link

:free-from-foreign shouldn't have a default value. #10

Open Ferada opened 6 years ago

Ferada commented 6 years ago

The right values for :free-from-foreign and :free-to-foreign are likely always up to the specific function contract. Failure to get this right will either leak memory, or, worse, cause memory corruption (by double free mostly) because the Lisp isn't supposed to e.g. touch the nodes in a GList.

Thus, having found at least one incorrect value, we'll have to check each current one, specify a value if none was given, and set the default :initform to something like (error ...) to ensure that a developer will have to think about this.