Proper way to free a pointer array in SWIG input typemap?
Hi I'm trying to wrap the following function using SWIG. static void readTable(int argc, t_atom *argv) { //accepts table in Lua e.g. readTable({"ab",3}); for (int i=0; i<argc; ++i) { if (argv[i].a_type == A_FLOAT) printf("FLOAT : %g\n", argv[i].a_w.w_float); else if (argv[i].a_type == A_SYMBOL) printf("SYMBOL : %s\n", argv[i].a_w.w_symbol->s_name); } } Here's the typemap I created. %include "exception.i" %typemap(in) (int argc, t_atom *argv) { if (!lua_istable(L, 1)) { SWIG_exception(SWIG_RuntimeError, "argument mismatch: table expected"); } lua_len(L, 1); $1 = lua_tointeger(L, -1); $2 = (t