changeset 410:eb554255ea5f default tip

*: no crash
author Paper <paper@tflc.us>
date Thu, 02 Apr 2026 01:09:09 -0400
parents 8d06825d96d1
children
files include/library/library.h src/library/library.cc
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/include/library/library.h	Thu Apr 02 00:18:56 2026 -0400
+++ b/include/library/library.h	Thu Apr 02 01:09:09 2026 -0400
@@ -15,6 +15,7 @@
 class Database final {
 public:
 	Database();
+	~Database();
 
 	/* Update watchers from current library paths */
 	void UpdateWatchers();
--- a/src/library/library.cc	Thu Apr 02 00:18:56 2026 -0400
+++ b/src/library/library.cc	Thu Apr 02 01:09:09 2026 -0400
@@ -24,6 +24,13 @@
 	 * called. */
 }
 
+Database::~Database()
+{
+	/* Wait */
+	if (refresh_thread_.joinable())
+		refresh_thread_.join();
+}
+
 void Database::UpdateWatchers()
 {
 	/* TODO also need to remove unused watchers */