speechd-discuss
[Top][All Lists]
Advanced

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

Please remove the cicero module


From: Samuel Thibault
Subject: Please remove the cicero module
Date: Wed, 9 Jan 2019 00:42:02 +0100

Didier Spaier, le mar. 08 janv. 2019 14:56:02 +0100, a ecrit:
> On 08/01/2019 14:27, Samuel Thibault wrote:
> > In which case does the segfault appear?
> 
> Only if cicero is not installed

Does the attached patch fix this?

Samuel
-------------- next part --------------
diff --git a/src/modules/cicero.c b/src/modules/cicero.c
index 5645eed7..bdc72109 100644
--- a/src/modules/cicero.c
+++ b/src/modules/cicero.c
@@ -40,6 +40,8 @@
 // #define DEBUG_MODULE 1
 DECLARE_DEBUG()
 
+static int initialized = 0;
+
 /* Thread and process control */
 static int cicero_speaking = 0;
 
@@ -227,6 +229,8 @@ int module_init(char **status_info)
 
        *status_info = g_strdup("Cicero initialized successfully.");
 
+       initialized = 1;
+
        return 0;
 }
 
@@ -297,10 +301,15 @@ int module_close(void)
                module_stop();
        }
 
+       if (!initialized)
+               return -1;
+
        if (module_terminate_thread(cicero_speaking_thread) != 0)
                return -1;
 
        sem_destroy(&cicero_semaphore);
+
+       initialized = 0;
        return 0;
 }
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]