[PATCH BlueZ] shared/shell: Add bt_shell_cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This releases resources used for shell initialization.
This is needed as a separate function to enable clean shutdown
when an application needs to exit prior to calling bt_shell_run(),
e.g., when failing program initialization based on processed command
line input options.
---
 src/shared/shell.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/shared/shell.c b/src/shared/shell.c
index 10f26264f..33bc0d980 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -1001,11 +1001,16 @@ void bt_shell_run(void)
 
 	mainloop_run();
 
+	io_destroy(signal);
+
+	bt_shell_cleanup();
+}
+
+void bt_shell_cleanup(void)
+{
 	bt_shell_release_prompt("");
 	bt_shell_detach();
 
-	io_destroy(signal);
-
 	if (data.envs) {
 		queue_destroy(data.envs, env_destroy);
 		data.envs = NULL;
-- 
2.13.6

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux