Browse Source

libobs: Fix signal handler lock bug

There was a return statement within a section of code that had a locked
mutex.
jp9000 11 years ago
parent
commit
d891e9772c
1 changed files with 6 additions and 3 deletions
  1. 6 3
      libobs/callback/signal.c

+ 6 - 3
libobs/callback/signal.c

@@ -173,11 +173,14 @@ void signal_handler_connect(signal_handler_t handler, const char *signal,
 
 	pthread_mutex_lock(&handler->mutex);
 	sig = getsignal(handler, signal, &last);
-	if (!sig)
-		return;
-
 	pthread_mutex_unlock(&handler->mutex);
 
+	if (!sig) {
+		blog(LOG_WARNING, "signal_handler_connect: "
+		                  "signal '%s' not found", signal);
+		return;
+	}
+
 	/* -------------- */
 
 	pthread_mutex_lock(&sig->mutex);