[dvblast-devel] Remove only valid config entries on exit.

Georgi Chorbadzhiyski git at videolan.org
Wed Jan 23 12:26:00 CET 2013


dvblast | branch: master | Georgi Chorbadzhiyski <gf at unixsol.org> | Wed Jan 23 13:15:03 2013 +0200| [923da2b8e464a423a6136b987c5faf73bed98901] | committer: Georgi Chorbadzhiyski

Remove only valid config entries on exit.

This prevents crash on exit when a config entry was removed while
dvblast was running and the configration was reloaded.

> http://git.videolan.org/gitweb.cgi/dvblast.git/?a=commit;h=923da2b8e464a423a6136b987c5faf73bed98901
---

 output.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/output.c b/output.c
index f50bc6b..fea36f1 100644
--- a/output.c
+++ b/output.c
@@ -534,11 +534,14 @@ void outputs_Close( int i_num_outputs )
     {
         output_t *p_output = pp_outputs[i];
 
-        msg_Dbg( NULL, "removing %s", p_output->config.psz_displayname );
+        if ( p_output->config.i_config & OUTPUT_VALID )
+        {
+            msg_Dbg( NULL, "removing %s", p_output->config.psz_displayname );
 
-        if ( p_output->p_packets )
-            output_Flush( p_output );
-        output_Close( p_output );
+            if ( p_output->p_packets )
+                output_Flush( p_output );
+            output_Close( p_output );
+        }
 
         free( p_output );
     }



More information about the dvblast-devel mailing list