From 9e283e248948a0de377f0c1e51461a57db31b9ee Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Tue, 15 Jul 2014 12:05:35 -0400 Subject: [PATCH] ffi: reset FFI compilation result attached to the module Signed-off-by: Jean Privat --- src/common_ffi/common_ffi.nit | 2 +- src/compiler_ffi.nit | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/common_ffi/common_ffi.nit b/src/common_ffi/common_ffi.nit index 9d793e4..302c472 100644 --- a/src/common_ffi/common_ffi.nit +++ b/src/common_ffi/common_ffi.nit @@ -24,7 +24,7 @@ import modelbuilder import nitni -import ffi_base +intrude import ffi_base import extern_classes import header_dependency import pkgconfig diff --git a/src/compiler_ffi.nit b/src/compiler_ffi.nit index b885bc7..14ae43f 100644 --- a/src/compiler_ffi.nit +++ b/src/compiler_ffi.nit @@ -51,6 +51,15 @@ redef class MModule for file in nitni_ccu.files do v.compiler.extern_bodies.add(new ExternCFile(file, c_compiler_options)) end + + # reset FFI things so the next compilation job, if any, starts with a clean context + # FIXME clean and rationalize this + nitni_ccu = null + compiled_ffi_methods.clear + ffi_ccu = null + ffi_files.clear + compiled_callbacks.clear + #Do not reset `foreign_callbacks` and `ffi_callbacks` because they are computed in previous phases end private fun ensure_compile_nitni_base(v: AbstractCompilerVisitor) -- 1.7.9.5