Signed-off-by: Thomas Spura <[email protected]>
---
devices/device.cpp | 7 +++++++
devices/device.h | 1 +
main.cpp | 2 ++
3 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/devices/device.cpp b/devices/device.cpp
index 6fc72a6..d2d5a61 100644
--- a/devices/device.cpp
+++ b/devices/device.cpp
@@ -343,3 +343,10 @@ void create_all_devices(void)
}
+void clear_all_devices(void)
+{
+ for (int i = 0; i < all_devices.size(); i++) {
+ delete all_devices[i];
+ }
+ all_devices.clear();
+}
diff --git a/devices/device.h b/devices/device.h
index c5c78b7..9741243 100644
--- a/devices/device.h
+++ b/devices/device.h
@@ -84,5 +84,6 @@ extern void report_devices(void);
extern void create_all_devices(void);
+extern void clear_all_devices(void);
#endif
diff --git a/main.cpp b/main.cpp
index cc1c7d3..f545c92 100644
--- a/main.cpp
+++ b/main.cpp
@@ -403,6 +403,8 @@ int main(int argc, char **argv)
end_pci_access();
reset_display();
+ clear_all_devices();
+
return 0;
--
1.7.7.6
_______________________________________________
Power mailing list
[email protected]
https://bughost.org/mailman/listinfo/power