浏览代码

Merge pull request #4814 from haesbaert/dns-cleanup

Cleanup allocated dns runtime data
Jeroen van Rijn 7 月之前
父节点
当前提交
963663b8e1
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      core/net/dns.odin

+ 3 - 0
core/net/dns.odin

@@ -50,9 +50,12 @@ init_dns_configuration :: proc() {
 	dns_configuration.hosts_file,  _ = replace_environment_path(dns_configuration.hosts_file)
 }
 
+@(fini, private)
 destroy_dns_configuration :: proc() {
 	delete(dns_configuration.resolv_conf)
+	dns_configuration.resolv_conf = ""
 	delete(dns_configuration.hosts_file)
+	dns_configuration.hosts_file = ""
 }
 
 dns_configuration := DEFAULT_DNS_CONFIGURATION