FreeBSD: Add system cleanup function.
authorEric Anholt <eric@anholt.net>
Thu, 1 Mar 2007 18:49:13 +0000 (10:49 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 1 Mar 2007 23:27:32 +0000 (15:27 -0800)
src/freebsd_pci.c

index a7d5c05..a4a8f44 100644 (file)
@@ -319,8 +319,17 @@ pci_device_freebsd_probe( struct pci_device * dev )
     return 0;
 }
 
+static void
+pci_system_freebsd_destroy()
+{
+    close(freebsd_pci_sys->pcidev);
+    free(freebsd_pci_sys->pci_sys.devices);
+    free(freebsd_pci_sys);
+    freebsd_pci_sys = NULL;
+}
+
 static const struct pci_system_methods freebsd_pci_methods = {
-    .destroy = NULL, /* XXX: free memory */
+    .destroy = pci_system_freebsd_destroy,
     .destroy_device = NULL,
     .read_rom = NULL, /* XXX: Fill me in */
     .probe = pci_device_freebsd_probe,