]> git.sesse.net Git - vlc/commitdiff
Save the plugins cache as early as possible
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 25 Jan 2010 18:29:56 +0000 (20:29 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 25 Jan 2010 18:29:56 +0000 (20:29 +0200)
This rgeatly reduces the changes that it's generated more than once,
if there are multiple concurrent VLC's, or if VLC crashes before exit.

src/modules/modules.c

index ebc1d08853d5f43cd5ea2f6aa9525590bf089a1a..267267c73063e22330195882ac2068bd3d81eb9b 100644 (file)
@@ -164,8 +164,6 @@ void module_EndBank( vlc_object_t *p_this, bool b_plugins )
     vlc_mutex_unlock( &module_lock );
 
 #ifdef HAVE_DYNAMIC_PLUGINS
-    if( p_bank->b_cache )
-        CacheSave( p_this, p_bank );
     while( p_bank->i_loaded_cache-- )
     {
         if( p_bank->pp_loaded_cache[p_bank->i_loaded_cache] )
@@ -215,6 +213,8 @@ void module_LoadPlugins( vlc_object_t * p_this, bool b_cache_delete )
         if( p_module_bank->b_cache || b_cache_delete )
             CacheLoad( p_this, p_module_bank, b_cache_delete );
         AllocateAllPlugins( p_this, p_module_bank );
+        if( p_module_bank->b_cache )
+            CacheSave( p_this, p_bank );
         config_UnsortConfig ();
         config_SortConfig ();
     }