From 9dee41c01724dafd85585a33d8dda677d8492bcb Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 13 Apr 2009 23:55:48 +0200 Subject: [PATCH] Plugin: try to load all shared libraries first Try to load all shared libraries before resolving any symbols. Fixes problems with plugins that are linked against other shared libraries located in LMMS' plugin directory. (cherry picked from commit 9a4b4f3cfea9f8fb2ca1dbe08866b8bfec9fd306) --- src/core/plugin.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/plugin.cpp b/src/core/plugin.cpp index 631a06b22..c51c2b3d9 100644 --- a/src/core/plugin.cpp +++ b/src/core/plugin.cpp @@ -3,7 +3,7 @@ /* * plugin.cpp - implementation of plugin-class including plugin-loader * - * Copyright (c) 2005-2008 Tobias Doerffel + * Copyright (c) 2005-2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -145,10 +145,13 @@ void plugin::getDescriptorsOfAvailPlugins( QVector & _plugin_descs ) QFileInfoList list = directory.entryInfoList( QStringList( "lib*.so" ) ); #endif - for( QFileInfoList::iterator file = list.begin(); - file != list.end(); ++file ) + foreach( const QFileInfo & f, list ) + { + QLibrary( f.absoluteFilePath() ).load(); + } + + foreach( const QFileInfo & f, list ) { - const QFileInfo & f = *file; QLibrary plugin_lib( f.absoluteFilePath() ); if( plugin_lib.load() == FALSE || plugin_lib.resolve( "lmms_plugin_main" ) == NULL )