Commits

Harald Klimach  committed bf3f646

Openlibs, only if they were not already opened for this Lua state before.

  • Participants
  • Parent commits 4671a6a

Comments (0)

Files changed (1)

File LuaFortran/flu_binding.f90

   type :: flu_State
     private
     type(c_ptr) :: state = c_null_ptr
+    logical :: opened_libs = .false.
   end type flu_State
 
   public :: flu_State
   subroutine fluL_openlibs(L)
     type(flu_State) :: L
     
-    call luaL_openlibs(L%state)
+    if (.not. L%opened_libs) then
+      call luaL_openlibs(L%state)
+      L%opened_libs = .true.
+    end if
   end subroutine fluL_openlibs
 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!