Browse Source

Merge pull request #4814 from haesbaert/dns-cleanup

Cleanup allocated dns runtime data
Jeroen van Rijn 7 months ago
parent
commit
963663b8e1
1 changed files with 3 additions and 0 deletions
  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