Skip to content
Snippets Groups Projects
Commit cf508c7b authored by Marek Vavruša's avatar Marek Vavruša
Browse files

modules/tinyweb: cleanup on exit

parent f3b32a2f
Branches
Tags
No related merge requests found
...@@ -58,7 +58,7 @@ endef ...@@ -58,7 +58,7 @@ endef
define go_target define go_target
$(1) := $(2)/$(1)$(LIBEXT) $(1) := $(2)/$(1)$(LIBEXT)
$(2)/$(1)$(LIBEXT): $$($(1)_SOURCES) $$($(1)_DEPEND) $(2)/$(1)$(LIBEXT): $$($(1)_SOURCES) $$($(1)_DEPEND)
@echo " GO $(2)"; CGO_CFLAGS="$(BUILD_CFLAGS)" CGO_LDFLAGS="$$($(1)_LIBS)" $(GO) build -buildmode=c-shared -o $$@ $$($(1)_SOURCES) @echo " GO $(2)"; CGO_CFLAGS="$(BUILD_CFLAGS)" CGO_LDFLAGS="$$($(1)_LIBS) $(CFLAGS)" $(GO) build -buildmode=c-shared -o $$@ $$($(1)_SOURCES)
$(1)-clean: $(1)-clean:
$(RM) -r $(2)/$(1).h $(2)/$(1)$(LIBEXT) $(RM) -r $(2)/$(1).h $(2)/$(1)$(LIBEXT)
ifeq ($$(strip $$($(1)_INSTALL)),) ifeq ($$(strip $$($(1)_INSTALL)),)
......
...@@ -14,6 +14,7 @@ static inline const knot_layer_api_t *_layer(void) ...@@ -14,6 +14,7 @@ static inline const knot_layer_api_t *_layer(void)
import "C" import "C"
import ( import (
"os" "os"
"runtime"
"unsafe" "unsafe"
"fmt" "fmt"
"net" "net"
...@@ -187,6 +188,9 @@ func tinyweb_config(module *C.struct_kr_module, conf *C.char) int { ...@@ -187,6 +188,9 @@ func tinyweb_config(module *C.struct_kr_module, conf *C.char) int {
//export tinyweb_deinit //export tinyweb_deinit
func tinyweb_deinit(module *C.struct_kr_module) int { func tinyweb_deinit(module *C.struct_kr_module) int {
geo_db = nil
geo_db6 = nil
runtime.GC()
return 0 return 0
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment