From dbe9317aed79bb65f16e5cb680971760dbe5f6a6 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 3 Sep 2017 21:13:09 +1000 Subject: Don't reset metamethods when reset is 0 Fixes issue where interposed methods were discarded if any more C modules were loaded Closes #104 --- src/openssl.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/openssl.c b/src/openssl.c index 5507762..f0d2a38 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -1191,6 +1191,9 @@ static _Bool auxL_newclass(lua_State *L, const char *name, const auxL_Reg *metho _Bool fresh = auxL_newmetatable(L, name, reset); int n; + if (!reset && !fresh) + return fresh; + auxL_setfuncs(L, metamethods, 0); if ((n = auxL_liblen(methods))) { -- cgit v1.2.3-55-g6feb