]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/tinyweb: cleanup on exit
authorMarek Vavruša <marek.vavrusa@nic.cz>
Fri, 13 Nov 2015 12:43:06 +0000 (13:43 +0100)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Fri, 13 Nov 2015 12:43:06 +0000 (13:43 +0100)
modules/modules.mk
modules/tinyweb/tinyweb.go

index 5028924591e7350f580d95569dbcec4ddb5ead18..1762f2aeab0acaf9b3871e5ebfdae94f72229501 100644 (file)
@@ -58,7 +58,7 @@ endef
 define go_target 
 $(1) := $(2)/$(1)$(LIBEXT)
 $(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:
        $(RM) -r $(2)/$(1).h $(2)/$(1)$(LIBEXT)
 ifeq ($$(strip $$($(1)_INSTALL)),)
index 16aa1bd25a6355196db011fecbdae80d2ff81f91..23e736f0d36aedce2629d937a63e95f4f942d1c2 100644 (file)
@@ -14,6 +14,7 @@ static inline const knot_layer_api_t *_layer(void)
 import "C"
 import (
        "os"
+       "runtime"
        "unsafe"
        "fmt"
        "net"
@@ -187,6 +188,9 @@ func tinyweb_config(module *C.struct_kr_module, conf *C.char) int {
 
 //export tinyweb_deinit
 func tinyweb_deinit(module *C.struct_kr_module) int {
+       geo_db = nil
+       geo_db6 = nil
+       runtime.GC()
        return 0
 }