userlibandfileserver/fileserver/sfile/sf_plugin_man.cpp
branchRCL_3
changeset 36 bbf8bed59bcb
parent 2 4122176ea935
child 43 c1f20ce4abcf
--- a/userlibandfileserver/fileserver/sfile/sf_plugin_man.cpp	Tue May 25 14:09:55 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_plugin_man.cpp	Wed Jun 09 11:10:19 2010 +0300
@@ -745,11 +745,12 @@
 
 	FsPluginManager::LockChain();
 	TInt count = FsPluginManager::ChainCount();
+	TInt oldCount = count;
 	TInt i;
 	for(i=0; i<count; i++)
 	    {
 	    CFsPlugin* plugin = NULL;
-	    User::LeaveIfError(FsPluginManager::Plugin(plugin, i));
+	    (void) FsPluginManager::Plugin(plugin, i); // (void) as chain is locked.
 	    __ASSERT_DEBUG(plugin, User::Leave(KErrNotFound));
 	    aRequest->iCurrentPlugin = plugin;
 	    aRequest->Status() = KRequestPending;
@@ -761,6 +762,12 @@
 	    FsPluginManager::LockChain();
 	    __ASSERT_ALWAYS(aRequest->Status().Int()==KErrNone||aRequest->Status().Int()==KErrCancel,Fault(ESessionDisconnectThread2));
 	    count = FsPluginManager::ChainCount();
+	    //If a plugin was removed whilst the chain was unlocked we need to make sure we don't skip any plugins
+	    if(count != oldCount)
+	        {
+	        i=0;
+	        oldCount = count;
+	        }
 	    }
 	FsPluginManager::UnlockChain();