]> git.sesse.net Git - vlc/commitdiff
Extensions: fix vlc.deactivate() malfunction
authorJean-Philippe André <jpeg@videolan.org>
Wed, 5 May 2010 13:27:52 +0000 (21:27 +0800)
committerJean-Philippe André <jpeg@videolan.org>
Wed, 5 May 2010 13:33:19 +0000 (21:33 +0800)
Inspired by jetru's patches, thank you. This should fix #3451

modules/misc/lua/extension_thread.c

index 9df6bbd18fb7221bfcbaf34cec9271dcb91a7b01..78a260872c8ba413948b4251d2edc787a15c1323 100644 (file)
@@ -146,12 +146,16 @@ int Deactivate( extensions_manager_t *p_mgr, extension_t *p_ext )
     }
 
     /* Free the list of commands */
-    FreeCommands( p_ext->p_sys->command );
+    if( p_ext->p_sys->command )
+        FreeCommands( p_ext->p_sys->command->next );
 
     /* Push command */
     struct command_t *cmd = calloc( 1, sizeof( struct command_t ) );
     cmd->i_command = CMD_DEACTIVATE;
-    p_ext->p_sys->command = cmd;
+    if( p_ext->p_sys->command )
+        p_ext->p_sys->command->next = cmd;
+    else
+        p_ext->p_sys->command = cmd;
 
     vlc_cond_signal( &p_ext->p_sys->wait );
     vlc_mutex_unlock( &p_ext->p_sys->command_lock );